W
W
Win32Sector2019-03-22 12:18:00
Nginx
Win32Sector, 2019-03-22 12:18:00

nginx. How to make friends 2 proxies?

Good day.
Tell me how to set up a bunch of two proxies?
There are a lot of web applications on the server, to which nginx proxied requests and locations in the form of #main
face
location / {
root /var/www/html;
try_files $uri $uri/ /index.html = 404;
}
#apps
location /app1 {
proxy_pass app1:8080
}
location /app2 {
proxy_pass app2:8080
}
And so on.
Now another proxy has been placed before this proxy, requests should now be sent to it and from it already be proxied to various sites and services. I made a config of a new virtual host for my project on the upstream proxy and requests to / forward just proxy_pass ip-address-second-proxy/, and I try to proxy requests to /app1, /app2 at 80 - the main one opens, if at 8080, then I get Access Denied
And I will not understand in any way how to transfer requests from the forward standing proxy to the standing one behind?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
ky0, 2019-03-22
@Win32Sector

Separate locations on the new nginx are not needed, just proxy everything from it to port 80 of the old nginx, it will already figure it out by the url.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question