$host includes port for reverse proxy

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:

My bad. I didn’t have correct “proxy_set_header” settings.

Posted at Nginx Forum: