Welcome! Log In Create A New Profile

Advanced

$host includes port for reverse proxy

Posted by coombesy 
coombesy
$host includes port for reverse proxy
June 26, 2012 10:40AM
I am trying to run a data server behind nginx by using a reverse proxy.
My problem is that the host name received by my application contains the
port of the proxied server not the port of the initial request i.e. a
request to http://myserver/dataserver is forwarded to /dataserver:30084
but my appliaction gets myserver:30084 instead of myserver. It is a
requirement that I know the port of the original request so as to be
able to operate on a port other than 80. As it stands I am having to
programatically remove the port.

This is part of my nginx.conf:

server {
listen 80;
server_name localhost;

location / {
root html;
index example.html example.htm;
}

location /dataserver {
proxy_pass http://localhost:30084/dataserver;
proxy_set_header Host $host;
}

Any help would be appreciated.

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,227919,227919#msg-227919

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
coombesy
Re: $host includes port for reverse proxy
August 31, 2012 06:40AM
My bad. I didn't have correct "proxy_set_header" settings.

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,227919,230361#msg-230361

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Sorry, only registered users may post in this forum.

Click here to login