1

I have several applications under Tomcat server. So I want a subdomain for each application. So, if a user want to access an application, has to put https://app1.domain.com... to access Tomcat application domain.com/app1/, domain.com/app2/ each.

I have succesfully configured apache with a wildcard certificate to use SSL. But not redirecting when accessing subdomain to each appplication. Just getting a ERR_TOO_MANY_REDIRECTS error.

Here are the ssl.conf file:

<VirtualHost 10.0.0.1:443> ServerAdmin [email protected] DocumentRoot "/var/www/html" ServerName www.domain.com ServerAlias domain.com ErrorLog logs/ssl_error.log DirectoryIndex index.html SSLEngine on SSLProtocol All +TLSv1.2 -SSLv2 -SSLv3 SSLCertificateFile /opt/certs/domain.com.crt SSLCertificateKeyFile /opt/certs/domain.com.key SSLCertificateChainFile /opt/certs/domain.com.intermediate.crt <Directory "/var/www/html"> Order allow,deny Allow from all </Directory> </VirtualHost> <VirtualHost 10.0.0.1:443> DocumentRoot "/var/www/html/app1" ServerName app1.domain.com UseCanonicalName Off DirectoryIndex index.html ProxyRequests Off ProxyPreserveHost On <Proxy *> Order deny,allow Allow from all </Proxy> ProxyPass / http://localhost:8080/app1/ ProxyPassReverse / http://localhost:8080/app1/ SSLEngine On SSLProtocol All +TLSv1.2 -SSLv2 -SSLv3 SSLCertificateFile /opt/certs/domain.com.crt SSLCertificateKeyFile /opt/certs/domain.com.key SSLCertificateChainFile /opt/certs/domain.com.intermediate.crt ErrorLog /var/log/httpd/ssl_app1_error.log LogLevel error <Directory "/var/www/html/app1"> Order allow,deny Allow from all Options None </Directory> </VirtualHost> 

Any idea? and how to keep SSL running on the redirection, HTTPS not just HTTP?

Thanks

1
  • I think the problem is on the tomcat side, maybe this is attempting to redirect http to https (Eg: 8080 -> 8443) Commented Oct 4, 2016 at 16:45

1 Answer 1

0

Rule of thumb is to always use NameVirtualHost before every VirtualHost, unless you know what you are doing. The basic template for every SSL port (for example 443) is:

Listen 443 SSLInsecureRenegotiation off NameVirtualHost *:443 <VirtualHost *:443> ... 

Also, you were correct in redirecting to http://localhost:8080/app1/

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.