我有一个在“http://localhost:8080/appexploded/login.jsp”(Tomcat)上运行的 tomcat 应用程序。现在我已经安装了 Apache 并且正在运行 mod_proxy,以便端口 80 上的所有请求都可以代理到 8080。在我的 httpd.conf 文件中,这是我所拥有的:
LoadModule proxy_module /usr/lib/apache2/modules/mod_proxy.so
ProxyPass /ordergeek http://localhost:8080/appexploded
ProxyPassReverse /ordergeek http://localhost:8080/appexploded
因此,当我直接向 :8080 发出请求时,我的 request.getSession().getAttribute("BLAH") 从一页到另一页工作。但是,当我转到“http://localhost/ordergeek/login.jsp”时,该页面设置了一个会话属性,然后重定向到另一个页面。但是,下一页尝试读取 request.getSession().getAttribute("BLAH"),但没有找到。
当我不通过代理时……会话属性起作用。当我通过代理时,他们没有。我错过了什么?
我在 server.xml 中添加了以下内容:
<Connector port="8080"
proxyName="www.myappurl.com"
proxyPort="80"/>