0

I'm deploying a spring application to a tomcat7 server. It works ok, but when i try to set up an apache proxy in front of that spring security (authentication) does not work, it's always redirecting to the login page.

The proxy configuration i'm trying:

<VirtualHost *:80>
    ServerName www.myhost.com 

    <Proxy *>
        Order deny,allow
        Allow from all
    </Proxy>

    ProxyPreserveHost Off
    ProxyPass / http://192.168.0.2:8080/my-spring-app/
    ProxyPassReverse / http://192.168.0.2:8080/my-spring-app/
    ProxyPassReverseCookiePath /my-spring-app /
</VirtualHost>

I've copied the configuration from other proxy working ok on top of another spring application.

I need to make this deployment without using an ajp proxy. Any clues?

roirodriguez
  • 1,685
  • 2
  • 17
  • 31

1 Answers1

0

Could you check the created cookie and provide all the details (path, domain...)?

Is there a specific reason why you set ProxyPreserveHost to Off?

Consider ProxyPassReverseCookieDomain to prevent domain mismatch, if it's the case.

Also, if you're using Apache as a reverse proxy only, you should set ProxyRequests to Off:

In a typical reverse proxy or gateway configuration, this option should be set to Off.