您的位置:首页技术文章
文章详情页

java - nginx影响了request取值

浏览:55日期:2023-08-21 08:36:21

问题描述

通过nginx代理后,request.getSession(true).getServletContext()取值为null,直接ip加端口访问tomcat却可以取到path,求问哪位大神有没有遇到过这个问题?有人说:

proxy_set_header Host $host; //解决getRequestURL、getServerName、getServerPort

但是proxy_set_header已经加了

问题解答

回答1:

你用request.getServletContext()试试呢

标签: java
相关文章: