How to configure apahce as reverse proxy for tomcat7?

Hello All, I have configured my tomcat7 to use SSL successfully on port 8443.
Now I want to accept for 443 port only I am using apache2 in front of it.
I added virtual host and this is the content:

ServerAlias *
ProxyPreserveHost on
ProxyRequests off

      <Proxy *>
              Order deny,allow
              Allow from all

SSLEngine on
SSLProxyEngine on
SSLVerifyClient None
SSLCertificateFile    /etc/letsencrypt/live/
SSLCertificateKeyFile /etc/letsencrypt/live/
SSLCertificateChainFile /etc/letsencrypt/live/

ProxyPass / http://localhost:8443/
ProxyPassReverse / http://localhost:8443/
RequestHeader set X-Forwarded-Proto "https"
RequestHeader set X-Forwarded-Port "443"

but I got this when I tried to connect to https://localhost

503 proxy Error the proxy server received an invalid response from an upstream server.

Also Should I configure certificate location for Apache also or just tomcat 7.
And How can I redirect any HTTP traffic to HTTPS.
Any help!

doesn't match
ServerAlias *
So without any extra "effort" you will not get the content you desire that way.
you should see: http://localhost:8443 content

If the server_name is the same, then you only need one cert.
If they can both access the same cert location, once cert and one location should be fine.
You would only need an additional TLS connection for an additional listening port.
In this case 8443 is already TLS, if you also want 443 to serve TLS, then you need to go through those motions.

A quick online search will show several ways.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.