My scenario looks us follows: 1. server - has a lot of domains 2. domain - application written in Spring MVC 3. apache2 - on server
In application user uses http when anonymous, when he is try to log in application requires HTTPS. I did it by spring security like this:
<http auto-config="true">
<intercept-url pattern="/user/add*" access="ROLE_ANONYMOUS" requires-channel="https"/>
<intercept-url pattern="/**" access="ROLE_USER, ROLE_ANONYMOUS"/>
<form-login login-page="/user/add" authentication-failure-url="/user/logFailed"></form-login>
<port-mappings>
<port-mapping http="8080" https="8181"/>
</port-mappings>
</http>
On local computer works fine, redirecting on https when clicks /user/add (login page). On server I use Proxy passes on apache2 us follows:
<VirtualHost *:80>
ProxyPass / http://127.0.0.1:8080/
ProxyPassReverse / http://127.0.0.1:8080/
Http works good, and every HTTP request on my domain is redirected and Glassfish gets it.
Problem is with Https. My proxy pass:
<IfModule mod_ssl.c>
<VirtualHost *domain*:8181>
ServerAdmin webmaster@localhost
ServerName *server*
ServerAlias www.*domain*
DocumentRoot /var/www/*domain*/
<Directory /var/www/*domain*/>
Options -Indexes
</Directory>
ProxyPass / https://127.0.0.1:8181/
ProxyPassReverse / https://127.0.0.1:8181/
I tried a lot of different configurations but I don't know where is problem. Requests are redirected to https but on address 127.0.0.1, which is of course localhost. When I changed ProxyPass to domain name it worked the same.
Where I have to reconfigure?
Also is it possible to get Glassfish working on 443 port, not 8181???