Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

Re: two virtual hosts with same domain name but different ports?

$
0
0
Hi,

I am done with my following configuration and it works,
make sure your firewall allows those ports

server {
listen 80;
location / {

proxy_pass "http://IP_AppServer:80";
proxy_set_header X-proxy IP_Nginx;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_next_upstream error timeout invalid_header http_500 http_404;
proxy_set_header X-Client-IP $remote_addr;
}
}
server {
listen 8080;
location / {

proxy_pass "http://IP_AppServer:8080";
proxy_set_header X-proxy IP_Nginx;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_next_upstream error timeout invalid_header http_500 http_404;
proxy_set_header X-Client-IP $remote_addr;
}
}

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>