Welcome! Log In Create A New Profile

Advanced

$host includes port for reverse proxy

June 26, 2012 04:35AM
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.
Subject Author Posted

$host includes port for reverse proxy

coombesy June 26, 2012 04:35AM

Re: $host includes port for reverse proxy

coombesy August 31, 2012 12:36AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 297
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready