Reverse proxy - nginx acts as a secondary proxy
为情所困
为情所困 2017-05-16 17:24:41
0
1
763

for example:

There is currently an HTTP proxy server A (10.0.0.1/24, 192.168.0.1/24) and a Web server B (192.168.0.2/24).

Machine C (10.0.0.3/24) can access the website on B by setting A as a proxy.

C machine has a public IP. Now you only have permission to make adjustments to C. How to configure nginx installed on C so that it can reverse proxy website B...

为情所困
为情所困

reply all(1)
我想大声告诉你

Since C and B are not on the same network segment, we can only use A, which is the secondary proxy you mentioned. Since you have implemented A proxy for B, you can set it up in the same way
Client<===>C<===>A<===>B
I wrote it down briefly:
nginx for C

upstream A{
    server 10.0.0.1:80;
}
server {
        listen       80;
        server_name  www.xxxx.com;

        location / {
                proxy_pass  http://A;
        }
}

A’s nginx

upstream B{
    server 192.168.0.2:80;
}
server {
        listen       80;
        location / {
                proxy_pass  http://B;
        }
}

That’s probably it, but I think you may have other needs

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template