Proxy behind firewall where ports don't match
Casey Rayman
casey.rayman at d2sc.com
Thu Jan 24 00:55:12 MSK 2008
Yes. That worked perfectly. I thought I had tried that already, but
obviously not!
Thank you,
Casey Rayman
On Jan 23, 2008, at 1:01 AM, Igor Sysoev wrote:
> On Tue, Jan 22, 2008 at 07:22:47PM -0600, Casey Rayman wrote:
>
>> I've got a situation where the port being served to the outside world
>> and the proxy port may not be the same. e.g. firewall:9000 => nginx:
>> 8080 => realserver:8000
>>
>> I'm currently using the following line which seems to take care of
>> everything but the port:
>> proxy_redirect http://realserver:8000 https://$host:9000;
>>
>> I'd like something like this:
>> proxy_redirect http://realserver:8000 https://$host:$port;
>>
>> Where $host:$port turns into firewall:9000 for the above example.
>> I've found variables for both the nginx port and the realserver port,
>> but can't find anything for the port the client sent the request to.
>
> There is no way to learn firewall's IP address and port on nginx
> side at all.
>
> You may try
>
> proxy_redirect http://realserver:8000 https://$http_host;
>
> this will work if client sends "Host: www.example.com:9000".
>
>
> --
> Igor Sysoev
> http://sysoev.ru/en/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20080123/6042c5cb/attachment.html>
More information about the nginx
mailing list