Hello,
Using the Nginx plus REST API I want to create the equivalent server entry that will have a server_name with example.somesite.com to do a reverse proxy to http://localhost:3000.
Example manual config:
server {
listen 80;
server_name example.somesite.com;
location / {
proxy_pass http://localhost:3000;
}
}
I have tried doing the following using Nginx plus REST API with a POST to http://localhost:8080/api/9/http/upstreams/vhosts/servers
POST
{
"server": "192.168.86.37:3001",
"route":"example.somesite.com",
"weight": 4,
"max_conns": 0,
"max_fails": 0,
"fail_timeout": "10s",
"slow_start": "10s",
"backup": true,
"down": true
}
It succeeds but I am not sure if this is the right way to implement a proxy pass. I know how to do it manually but translating this to the Nginx plus api is the confusion.
Thank You,
John Haigh
Edited 1 time(s). Last edit at 09/03/2024 08:50PM by johnhaigh.