using a proxied server as default_server

angelochen960 nginx-forum at
Fri May 31 02:16:28 UTC 2013


I have a tomcat app running behind nginx, it works, now I make it the
default_server, this works if it access with server name like,
but if access with an IP,, it does not work,  any idea ?

server {
    listen default_server;
    root /var/www/public_html;
    location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_redirect off;

Posted at Nginx Forum:,239707,239707#msg-239707

More information about the nginx mailing list