lundi 23 février 2015

Apache with Proxypass and Spring Security

I am having a Spring MVC app which uses Spring Security for login. I am using Apache Webserver as Proxy and Tomcat. Below is my /etc/apache2/sites-enabled/example.com.conf file:



ServerAdmin admin@example.com
ServerName example.com
ServerAlias www.example.com
DocumentRoot /var/www/http://ift.tt/18GT7ew

ProxyPreserveHost On
ProxyRequests off

ProxyPass /myapp/j_spring_security_check http://localhost:8080/myapp/j_spring_security_check
ProxyPassReverse /myapp/j_spring_security_check http://localhost:8080/myapp/j_spring_security_check
ProxyPass /myapp http://localhost:8080/myapp
ProxyPassReverse /myapp http://localhost:8080/myapp


This works fine and I am able to log into my site. However, I have to use http://ift.tt/x8TEmW instead of http://example.com. If I use later, it shows me:



Index of /

[ICO] Name Last modified Size Description
[IMG] favicon.ico 2015-02-23 14:15 7.6K


If I modify the example.com.conf file as suggested by other sites/posts, I get nothing and http://example.com takes me to http://ift.tt/x8TEmW:



ProxyPass /j_spring_security_check http://localhost:8080/j_spring_security_check
ProxyPassReverse /j_spring_security_check http://localhost:8080/j_spring_security_check
ProxyPass / http://localhost:8080/myapp
ProxyPassReverse / http://localhost:8080/myapp


Can some one please help? Thanks.


Aucun commentaire:

Enregistrer un commentaire