I'm trying to setup the GlassFish application server behind an Apache reverse proxy. I've got it working with both port 80 and 443, but the problem is the transition between the two that occurs when a user accesses a page that requires authentication which causes Glassfish to issue a redirect to the login page, and in turn requires SSL over Apache 443/GlassFish 8181. In this case the user's browser attempts to access the origin server directly, which in my case is localhost so actually causes the user to try to access their own local system (https://localhost:8181/myapp).
To get this far I added the following to httpd.conf:
<VirtualHost *:80>
ProxyPass /myapp http://localhost:8080/myapp
ProxyPassReverse /myapp http://localhost:8080/myapp
</VirtualHost>
And the following to ssl.conf:
<VirtualHost _default_:443>
SSLProxyEngine on
ProxyPass /myapp https://localhost:8181/myapp
ProxyPassReverse /myapp https://localhost:8181/myapp
...
I've tried to add an additional ProxyPassReverse directive, but that doesn't work, probably because it can't handle switching protocols. Maybe I need to add a RewriteRule directive? Or maybe I need to enable mod_proxy_html to rewrite content?
0 Answers