Welcome! Log In Create A New Profile

Advanced

ProxyPass to target need to pass another proxy

March 23, 2015 09:09AM
Hey guys,

I have the following plan.

I need to configure an nginx via proxypass. The target of the proxy itself is behind a proxy.

My config looks like this:

upstream @squid {
server XXX.YYY.FFF.EEE:3128;
}

server {
listen 80;
server_name install.peng.puff.de;

location ~ ^/(mirror/ubuntu|debian-peng/ubuntu|ppa/libreoffice/ppa/ubuntu|ppa/natecarlson/maven3/ubuntu|ppa/ondrej/php5-5.6/ubuntu|mirror/apt.puppetlabs.com|VirtualBox/debian|ppa/webupd8team/java/ubuntu)(.*)$ {
proxy_pass http://@squid/$scheme://$host$uri;
proxy_redirect off;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Request-URI $request_uri;
proxy_set_header Host install.peng.puff.de;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

}

The squid and host entry are concatinated but the squid is not able to parse it caused by the / between @squid/$scheme. So the squid tries to connect to :
1426763671.035 0 172.31.2.35 TAG_NONE/400 3706 GET /http://install.peng.puff.de/ppa/webupd8team/java/ubuntu/dists/trusty/main/source/Sources - HIER_NONE/- text/html

I also tried to delelte the slash but this try has been marked as invalid config by nginx.

Anyone another idea?

In apache2 it is "only" a ProxyRemote * XXX.YYY.FFF.EEE:3128 .
Subject Author Posted

ProxyPass to target need to pass another proxy

elronar March 23, 2015 09:09AM

Re: ProxyPass to target need to pass another proxy

Francis Daly March 23, 2015 09:40AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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