Welcome! Log In Create A New Profile

Advanced

RE: [IE] Can Nginx used as a reverse proxy send HTTP(s) requests through a forward proxy ?

December 07, 2017 01:04PM
Are you trying to do something like this?

server foo {
listen 443 ssl;

...other settings elided...

location /foo/ {
https://external_site/;
}
}

If https://external_site/ traverses a proxy then the answer is “no” – nginx can’t deal with proxy situations where it has to issue HTTP CONNECT. I don’t know much about squid but I expect you’ll have the same problem. You’ll see that requests will just …fail.

I got around it by creating a little node.js app to fetch the external resource from external_site and pointed nginx at the node app. Feels like a bit of a hack but it works well enough. Incidentally I found pm2 to be a really nice container to turn 50 lines of js into a decent service that runs as a non-privileged user, starts on boot, restarts automatically on exception, logs, etc. etc.

Jason


From: nginx [mailto:nginx-bounces@nginx.org] On Behalf Of Nicolas Legroux
Sent: Wednesday, December 06, 2017 4:48 PM
To: nginx@nginx.org
Subject: [IE] Can Nginx used as a reverse proxy send HTTP(s) requests through a forward proxy ?

Hi,

I'm wondering if it's possible to do what's described in the mail subject ?
I've had a look through Internet and docs but haven't been able to figure it out. The question is similar to the one that's asked here : https://stackoverflow.com/questions/45900356/how-to-configure-nginx-as-reverse-proxy-for-the-site-which-is-behind-squid-prox, but that thread doesn't provide an answer.
I've been able to do this with Apache and its ProxyRemote directive, but I can't figure out if this is doable with Nginx.


Thanks,

Nicolas

--

This message contains proprietary information from Equifax which may be confidential. If you are not an intended recipient, please refrain from any disclosure, copying, distribution or use of this information and note that such actions are prohibited. If you have received this transmission in error, please notify by e-mail postmaster@equifax.com. Equifax® is a registered trademark of Equifax Inc. All rights reserved.
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Can Nginx used as a reverse proxy send HTTP(s) requests through a forward proxy ?

Nicolas Legroux December 06, 2017 05:50PM

Re: Can Nginx used as a reverse proxy send HTTP(s) requests through a forward proxy ?

pbooth December 06, 2017 07:58PM

Re: Can Nginx used as a reverse proxy send HTTP(s) requests through a forward proxy ?

Francis Daly December 07, 2017 03:14AM

RE: [IE] Can Nginx used as a reverse proxy send HTTP(s) requests through a forward proxy ?

jasonw December 07, 2017 01:04PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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