0

I have a Tomcat server at port 8080 behind an Apache server at port 80.

I have virtual host setup with mod_rewrite which redirects to Tomcat using the below lines in 000-default.conf:

<VirtualHost *:80> 
  ProxyPreserveHost Off
  ProxyRequests Off
  RewriteEngine On
  RewriteOptions inherit
  ServerName job.nvoids.in
  ServerAlias jobs.nvoids.com jobs.nvoids.in www.jobs.nvoids.in
  ProxyPass / http://localhost:8080/jobs/
  ProxyPassReverse / http://localhost:8080/jobs/
  ProxyPassReverseCookieDomain localhost:8080 job.nvoids.in
</VirtualHost>

Now I'm losing all sessions at my Tomcat server.

For example, I retain the sessions with every page load at http://nvoids.in:8080/jobs/post.jsp (you can see the session ID in the page) but unfortunately at http://job.nvoids.in/post.jsp I'm getting a new session every time I reload the page.

How can I retain the session with Apache URL rewrite?

  • How is this related to PHP? And the issue isn't with mod-rewrite, it's the reverse proxy. –  Sep 12 '17 at 19:25

1 Answers1

0

Sounds like your session is only valid for nvoids.com and not jobs.nvoids.com also

Mike
  • 22,310
  • 7
  • 56
  • 79