After passing the nginx proxy, the value of request.getSession(true).getServletContext() is null. If you directly access tomcat with IP and port, you can get the path. Is there any expert who has encountered this problem?
someone said:
proxy_set_header Host $host; //解决getRequestURL、getServerName、getServerPort
But proxy_set_header has been added
Try using request.getServletContext()