Hello!
I'm looking to setup a transparent proxy with nginx. Here's basically how it will work...
I want request to go to nginx. Nginx then forwards all requests to our netscaler which will then do it's thing and pass the data back.
I've gotten nginx setup as a proxy. However, whenever I visit the site & am watching the developer tools it initially goes to nginx. Then it does a 302 & in the header information I see the IP address of my netscaler.
How do I get this to not show as a 302 & to return the IP address of our nginx server in the header over that of the netscaler/apache cluster. I guess I'm looking for nginx to act more as a bridge than a proxy? I'm unsure of the terminology for exactly what I'm looking for.
Here's what I have configured:
server { listen 80; server_name www.mydomain.com mydomain.com; root /var/www/mydomain.com/; if ($http_host != "www.mydomain.com") { rewrite ^ http://www.mydomain.com$request_uri permanent; } index index.php index.html; location / { proxy_pass http://ipofmyupstream:80; include /etc/nginx/proxy_params; } }
proxy_params:
proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
Can anyone give me any direction? Maybe point me to some documentation or a parameter I should investigate. Thanks!
[link] [comments]