Answer the question
In order to leave comments, you need to log in
How to proxy nginx to a domain name?
The task is to use VPS 1 as an IP address for domains, and store sites on VPS 2 , i.e. I need only an IP address from VPS 1 in order to create an A record for domains.
I used proxy_pass
On VPS 1, I created a cofing for the domain
location / {
proxy_pass testpage.ru;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
}
The catch is that the request goes to the IP address of the domain, on this IP address I have several dozen domains, I need to refer to a specific domain, how to do this?
For example, I access testpage.ru and I need to open the contents of testpage.ru which is on VPS2, but now I see another site that is hosted on the same IP
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question