Setup HTTP connector on 8080 and HTTPS connector on 8443. In your <Connector>
declaration add proxyPort
attribute and set it to default HTTP and HTTPS port ( 80 and 443 respectively ). Setup firewall redirect rule from 80 to 8080 and from 443 to 8443. Then the server will accept regular http and https URLs without the need to specify port numbers.
Below is a sample declaration of these connectors.
<Connector
maxSpareThreads='75'
port='8080'
proxyPort='80'
enableLookups='false'
maxThreads='150'
connectionTimeout='20000'
disableUploadTimeout='true'
minSpareThreads='5'
maxHttpHeaderSize='8192'
redirectPort='443'
acceptCount='200'
/>
<Connector
SSLEnabled='true'
keystoreFile='/path/to/keystore.jks'
maxSpareThreads='75'
port='8443'
proxyPort='443'
algorithm='SunX509'
enableLookups='false'
secure='true'
maxThreads='150'
connectionTimeout='20000'
disableUploadTimeout='true'
scheme='https'
minSpareThreads='5'
maxHttpHeaderSize='8192'
sslProtocol='SSL'
acceptCount='200'
clientAuth='false'
/>
And here are some redirect IPTABLES commands:
# Redirect external packets
-A PREROUTING -j NAT-Port-Redirect
# redirect http traffic
-A NAT-Port-Redirect -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 8080
# redirect https traffic
-A NAT-Port-Redirect -p tcp -m tcp --dport 443 -j REDIRECT --to-ports 8443