Hello,
I have a configuration question I hope someone can help fix. I have inherited Confluence and JIRA sites running on the same machine, the original and existing setup has Tomcat doing all the SSL termination, but this leaves users having to have port numbers in their URLs. This is no longer desired and in Test I have Apache doing the SSL termination and passing the requests back to Confluence and JIRA, this all works very well, looks great with no port numbers in the URLs, so the managers are pleased, but I worry there are users out there that have bookmarks set to lots of pages using the old URLs. In production, how can I setup Apache to forward/rewrite requests for something like https://jira.mysite.com:8443/<some-URI> to https://jira.mysite.com/<some-URI> ? I have Confluence and JIRA running on the same machines, but I have name-based Apache virtual hosts setup which appears to be working well, but I know there will be someone with bookmarked pages that will cause me no end of grief if I move this new setup into Production use without some consideration. Below are the old Apache and tomcat configs as well as the new.
I have tried copying the below 443 NameVirtualHost but the URL is not rewritten so the redirect fails and I get an SSL error. I get this is most likely an Apache issue, but was hoping someone here has run into this issue and gotten it sorted.
Old Setup:
server.xml defines the Listen address and the Connector port, the keys are all stored in the Java keystore and Apache is simply sitting in front of tomcat, listening on port 80, but just doing a simple redirect to the application, so the application port is included in the URL.
Tomcat:
<Service name="Catalina">
<Connector port="8080"
maxThreads="150"
minSpareThreads="25"
connectionTimeout="20000"
enableLookups="false"
maxHttpHeaderSize="8192"
protocol="HTTP/1.1"
useBodyEncodingForURI="true"
redirectPort="8443"
acceptCount="100"
disableUploadTimeout="true"
address="10.1.2.3" />
<Connector port="8443" protocol="org.apache.coyote.http11.Http11Protocol"
maxHttpHeaderSize="8192" SSLEnabled="true"
maxThreads="150" minSpareThreads="25"
enableLookups="false" disableUploadTimeout="true"
acceptCount="100" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS" useBodyEncodingForURI="true"
keyAlias="jira-test" keystoreFile="/opt/atlassian/data/keystore" />
Apache:
NameVirtualHost 10.1.2.3:80
<VirtualHost 10.1.2.3:80>
ServerAdmin sysadmin@xxxxxxxxxxxxxxxx.com
ServerName jira-test.mysite.com
Redirect permanent / https://jira-test.mysite.com:8443
</VirtualHost>Example URL:
https://jira-test.mysite.com:8443/browse/INFRA-747
New Setup:
Tomcat (localhost is named 'linux7030.mysite.com):
<Service name="Catalina">
<Connector port="8080"
proxyPort="443"
scheme="https"
proxyName="linux7030.mysite.com"
address="127.0.0.1"
maxThreads="150"
minSpareThreads="25"
connectionTimeout="20000"
enableLookups="false"
maxHttpHeaderSize="8192"
protocol="HTTP/1.1"
useBodyEncodingForURI="true"
redirectPort="8443"
acceptCount="100"
disableUploadTimeout="true"/>
SSL Connector is left commented out.Apache:
## JIRA Proxy VirtualHost Configuration
Listen 443
NameVirtualHost *:443
<VirtualHost *:443>
ServerAdmin sysadmin@mysite.com
ServerName linux7030.mysite.com:443
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
SSLProxyEngine On
ProxyRequests Off
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:8080/
ProxyPassReverse / http://127.0.0.1:8080/
SSLCertificateFile /etc/httpd/ssl/linux7030.cer
SSLCertificateKeyFile /etc/httpd/ssl/linux7030.key
SSLCertificateChainFile /etc/httpd/ssl/WestCAchain.cer
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
</VirtualHost>
NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin sysadmnin@mysite.com
ServerName linux7030.mysite.com:80
Redirect permanent / https://linux7030.mysite.com/
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
SSLProxyEngine On
ProxyRequests Off
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:8080/
ProxyPassReverse / http://127.0.0.1:8080/
</VirtualHost>Example URL:
https://linux7030.mysite.com/browse/SM-15
So what I think I need is possibly a new Virtual Host in Apache to correctly send or re-write requests to the old URLs to the new, which will not be using the 8443 port (or 9443 for Confluence...).
https://jira-test.mysite.com:8443/browse/INFRA-747
-> -> -> (fancy redirect/re-write icons)
https://jira-test.mysite.com/browse/INFRA-747
Please let me know if you have any questions and thanks in advance!
-Mike