我有一个基于eXist-db的应用程序。 这基本上是一个使用Jetty的Java Web应用程序。 它运行在Apache代理之后的远程Linux服务器上。
我使用下面的Apacheconfiguration:
ServerName domain.com ProxyRequests off ProxyPass /myapp http://localhost:8899/exist/apps/myapp ProxyPassReverse /myapp http://localhost:8899/exist/apps/myapp
一切工作正常,除了会议。 每次请求会话都会被更新。 这意味着请求Cookie头不包含JSESSIONID但响应Set-Cookie头是类似JSESSIONID=oryq5odyt3f79xxax25n7x0h;Path=/exist 。 此外,我检查确认会话是每次新的应用程序中的会话ID。
我已经尝试了三种testing场景:
testing场景A:
testing场景B:
testing场景C(本地):
问题出现在A和B两种情况下,但不在C中
任何想法如何使会议工作?
以下Apacheconfiguration解决了这个问题:
ServerName domain.com ProxyRequests off ProxyPass /myapp http://localhost:8899/exist/apps/myapp ProxyPassReverse /myapp http://localhost:8899/exist/apps/myapp ProxyPassReverseCookiePath /exist /
它将cookies从/exist的path更改为/ ,以便将会话正确映射到path。
在某些情况下,可能还需要使用以下指令来更改Cookie中的域(但在我的情况下不需要):
ProxyPassReverseCookieDomain localhost domain.com
我发现更多的细节在stackoverflow 。