nginx + tomcat 页面无法展示

location / project
    {       
      proxy_pass http://localhost:8081/project; 

       proxy_set_header Host $host:$server_port;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header REMOTE-HOST $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

    }

 proxy_set_header Host $host:$server_port;  这行配置是关键.这行配置是让转发带上端口.

加上这行以后就可以顺利访问了


你可能感兴趣的:(nginx + tomcat 页面无法展示)