Proxy server:port to https address
Wondering if the below is possible using nginx or if i am trying to use it incorrectly
I would like to listen on a port 8720 and forward all requests to a server url inside our network but not on the same box https://server\_2
I have attempted with config below in /etc/nginx/sites-enabled/default
server {
listen 8720;
server_name server_1;
location / {
proxy_pass https://server_2;
}
}
This produces a 502 bad gateway
I changed ot the below
server {
listen 8720;
server_name server_1;
location / {
proxy_pass http://server_2;
}
}
this produces upgrade required
EDIT 1 adding server detail for Server_1
Server_1 basic debian install with nginx installed directly. Can ping and wget server_2
Server_2 is fully functioning https server doing exactly what is needed and cannot be changed to listen on 8720 however I have legacy apps on the network that have the port hardcoded and cannot be changed
Any help/advice prreicated.