Answer the question
In order to leave comments, you need to log in
How to proxy to the same domain in Nginx?
Is it possible to proxy to a domain that matches the server name?
server {
listen 80;
server_name domain.com;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://domain.com;
}
}
Answer the question
In order to leave comments, you need to log in
127.0.0.1 - for this, it’s perfect what you come up with
if it’s on another server, then by IP,
because config substitution goes via http reffer
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question