title: apache mod_proxy tomcat remove 8443
body: <p>I put apache in front of tomcat using mod_proxy. The apache is listening on port 80, and when I access from www.example.com the apache redirect to port 8080 wich tomcat is listening, and tomcat redirect to port 8443. The problem is the address bar show <a href="https://www.example.com:8443" rel="nofollow noreferrer">https://www.example.com:8443</a>.</p>
  
  <p>How I remove the :8443 from the address bar?</p>
  
  <p>Apache virtualhost config</p>
  
  <pre><code>&lt;VirtualHost *:80&gt; 
   ProxyPreserveHost On
    ProxyRequests Off
    ServerName www.example.com
    ServerAlias example.com
    ProxyPass / http://localhost:8080/
    ProxyPassReverse / http://localhost:8080/
  &lt;/VirtualHost&gt; 
  </code></pre>
  
  <p>Tomcat server.xml</p>
  
  <pre><code>&lt;?xml version='1.0' encoding='utf-8'?&gt;
  
  &lt;Server port="8005" shutdown="SHUTDOWN"&gt;
  
    &lt;!--APR library loader. Documentation at /docs/apr.html --&gt;
    &lt;Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" /&gt;
    &lt;!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html --&gt;
    &lt;Listener className="org.apache.catalina.core.JasperListener" /&gt;
    &lt;!-- Prevent memory leaks due to use of particular java/javax APIs--&gt;
    &lt;Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" /&gt;
    &lt;!-- JMX Support for the Tomcat server. Documentation at /docs/non-existent.html --&gt;
    &lt;Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" /&gt;
    &lt;Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" /&gt;
  
    &lt;!-- Global JNDI resources
         Documentation at /docs/jndi-resources-howto.html
    --&gt;
    &lt;GlobalNamingResources&gt;
      &lt;!-- Editable user database that can also be used by
           UserDatabaseRealm to authenticate users
      --&gt;
      &lt;Resource name="UserDatabase" auth="Container"
                type="org.apache.catalina.UserDatabase"
                description="User database that can be updated and saved"
                factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
                pathname="conf/tomcat-users.xml" /&gt;
    &lt;/GlobalNamingResources&gt;
  
    &lt;Service name="Catalina"&gt;
  
      &lt;Connector port="8080" protocol="HTTP/1.1" 
                 connectionTimeout="20000" 
                 redirectPort="8443" /&gt;
  
              &lt;Connector SSLEnabled="true" clientAuth="false" keyAlias="key" keystoreFile="webapps/ROOT/META-INF/my.keystore" keystorePass="pass" maxThreads="150" port="8443" protocol="HTTP/1.1" scheme="https" secure="true" sslProtocol="TLS"/&gt;   
  
      &lt;!-- Define an AJP 1.3 Connector on port 8009 --&gt;
      &lt;Connector port="8009" protocol="AJP/1.3" redirectPort="8443" /&gt;
  
      &lt;Engine name="Catalina" defaultHost="localhost"&gt;
  
        &lt;Realm className="org.apache.catalina.realm.UserDatabaseRealm"
               resourceName="UserDatabase"/&gt;
  
        &lt;!-- Define the default virtual host
             Note: XML Schema validation will not work with Xerces 2.2.
         --&gt;
        &lt;Host name="localhost"  appBase="webapps"
              unpackWARs="true" autoDeploy="true"
              xmlValidation="false" xmlNamespaceAware="false"&gt;
  
        &lt;/Host&gt;
      &lt;/Engine&gt;
    &lt;/Service&gt;
  &lt;/Server&gt;
  </code></pre>
  
  <p>I'm using Tomcat 6, Apache 2.4 and Windows Server 2012</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>virtualhost</p>
  
  <pre><code> &lt;VirtualHost *:80&gt; 
   ProxyPreserveHost On
    ProxyRequests Off
    ServerName www.example.com
    ServerAlias example.com
    ProxyPass / http://localhost:8080/
    ProxyPassReverse / http://localhost:8080/
  &lt;/VirtualHost&gt; 
  
   &lt;VirtualHost _default_:443&gt; 
    SSLEngine on
    SSLCertificateKeyFile "${SRVROOT}/conf/ssl/example.key"
    SSLCertificateFile "${SRVROOT}/conf/ssl/www_example_com.crt"
    SSLCertificateChainFile "${SRVROOT}/conf/ssl/www_example_com.ca-bundle"
    ProxyPreserveHost On
    ProxyRequests Off
    ServerName www.example.com
    ServerAlias example.com
    ProxyPass / http://localhost:8080/
    ProxyPassReverse / http://localhost:8080/
  &lt;/VirtualHost&gt; 
  </code></pre>
  
  <p>server.xml</p>
  
  <pre><code>&lt;Server port="8005" shutdown="SHUTDOWN"&gt;
  &lt;Connector port="8080" protocol="HTTP/1.1" 
             connectionTimeout="20000" 
             redirectPort="8443" /&gt;         
  
  &lt;!-- Define an AJP 1.3 Connector on port 8009 --&gt;
  &lt;Connector port="8009" protocol="AJP/1.3" redirectPort="8443" /&gt;
  </code></pre>