Answer the question
In order to leave comments, you need to log in
Why doesn't nginx forward to the server when a name is specified in listen?
If I write in hosts on the client and on the server the external ip address of the server with the site address www.example.com (external local), and create an address for nginx
server {
listen www.example.com:80;
server_name www.example.com;
location / {
proxy_pass http://localhost:8095;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-for $remote_addr;
port_in_redirect off;
proxy_redirect http://www.example.com/ /;
}
}
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