Nginx Can't get the request port when doing proxy

higkoo nginx-forum at
Thu Nov 24 10:16:04 UTC 2011

such as :
    Client( want visit
example,and need visit other ports.
    but client must use proxy to visit. Nginx is the proxyer!

    Nginx proxy running on and listen at  port 8080 .
        I use '''proxy_pass $scheme://$host$request_uri;''' to make
proxy,but I get http-502 when I use this proxy-server.
    Becase nginx use the default port 80 to proxy:
        | request =
        | proxy-server = 8080
        | proxy-to  =       
    There are only $remote_port and $server_port on nginx-variables:

    If I just want visit port 9000 on,I can write by
'''proxy_pass $scheme://$host:9000$request_uri;'''
    But it's not a good idea ,and there are some other port to use.

    How can I do ?

Posted at Nginx Forum:,218934,218934#msg-218934

More information about the nginx mailing list