Welcome! Log In Create A New Profile

Advanced

reverse proxy through upstream proxy

pba
May 30, 2014 11:03PM
I'm trying to configure nginx as a reverse proxy where the upstream traffic has to go through another proxy (squid in this case) without success. Since nginx does not support (as far as I can tell) passing a proxy for upstream and because I need to reverse proxy only one domain (test.com) I've tried rewriting the URL and using proxy pass:

location / {
rewrite ^ http://test.com$request_uri;
proxy_set_header X-Custom SOMETOKEN;
proxy_pass http://my_squid:3128;
}

Unfortunately since the final URL generated by rewrite starts with http nginx immediately returns a 302 without forwarding the request to the proxy.

Any ideas how to solve this or if there are alternative solutions to what I'm trying to achieve ?

Thanks.
Subject Author Posted

reverse proxy through upstream proxy

pba May 30, 2014 11:03PM

Re: reverse proxy through upstream proxy

Francis Daly May 31, 2014 05:14AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 296
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