通过nginx代理后,request.getSession(true).getServletContext()取值为null,直接ip加端口访问tomcat却可以取到path,求问哪位大神有没有遇到过这个问题?
有人说:
proxy_set_header Host $host; //解决getRequestURL、getServerName、getServerPort
但是proxy_set_header已经加了
通过nginx代理后,request.getSession(true).getServletContext()取值为null,直接ip加端口访问tomcat却可以取到path,求问哪位大神有没有遇到过这个问题?
有人说:
proxy_set_header Host $host; //解决getRequestURL、getServerName、getServerPort
但是proxy_set_header已经加了
4 回答1.3k 阅读✓ 已解决
4 回答1.2k 阅读✓ 已解决
1 回答2.5k 阅读✓ 已解决
2 回答954 阅读
2 回答710 阅读✓ 已解决
2 回答1.7k 阅读
2 回答1.6k 阅读
你用request.getServletContext()试试呢