G
G
grabbee2019-06-04 11:15:06
Nginx
grabbee, 2019-06-04 11:15:06

How to proxy multiple sites in NGINX upstream?

That is, it comes to location and is divided by servername/domain, and refers to the proxy by IP address. Is it correct that you can further divide only by different ports (8001, 8002), if there is only one proxy server? Is it possible to use servername/domain somehow on a proxy if it is a private server with only an IP address?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
ivankomolin, 2019-06-04
@grabbee

It is not necessary to further divide by ports.
It is enough just to set the HOST header at the time of proxying
And then resolve on the destination server by server_name

V
Viktor Taran, 2019-06-04
@shambler81

yes it is possible.
After all, the web server parses the http_referer headers

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question