工程是布在tomcat里面的。nginx配置:server{listen8083;server_name域名;location/{indexindex.htmlindex.htmindex.jsp;#proxy_redirectoff;proxy_set_headerHost$host;proxy_set_headerX-Real-IP$remote_addr;proxy_set_headerX-Forwarded-For$proxy_add_x_forwarded_for;proxy_passhttp://127.0.0.1:8081/;}}直接通过域名无法访问,加个8081端口之后就能顺利访问了,直接IP+端口的方式也可以。刚将server_name后面的域名改成localhost之后,重启nginx之后,直接域名能访问,隔个十多分钟之后又不行了,还是得加端口。奇了怪了。
添加回答
举报
0/150
提交
取消