Confluence behing Apache SSL mod_proxy
Asked by chris hoerske:

I have an Apache install running in mod_proxy mode. JIRA and Confluence are behind it. At first I had the proxy and both JIRA/Confluence running on HTTP. It worked perfect. Today I installed a SSL cert on my Apache install and setup Apache to use HTTPS and talk to JIRA via HTTP. I tried to do the same thing with Confluence but for some reason it keeps on redireting back to HTTP. So, If I go to [](https://atlassian.mydomain.com/JIRA)<https://atlassian.mydomain.com/JIRA>it stays on HTTPS. If I go to [](http://atlassian.mydomain.com/confluence)<https://atlassian.mydomain.com/confluence> it redirects to HTTP. Not sure if this matters but my Apache SSL config is in /etc/httpd/conf.d/ssl.conf and not in /etc/httpd/conf/httpd.conf

Any ideas?


Answers:
author: FelipeA
body: Hi Chris,

I'm seeing two connectors for the same port (8090) on your server.xml. Please try removing the last one:

```
&lt;Connector port="8090" maxHttpHeaderSize="8192"maxThreads="150" minSpareThreads="25" maxSpareThreads="75"enableLookups="false" redirectPort="8443" disableUploadTimeout="true"acceptCount="100" URIEncoding="UTF-8" proxyName="host.mydomain.com" proxyPort="443" scheme="https" /&gt;
```

And adding the proxy related configurations to the first connector:

```
proxyName="host.mydomain.com" proxyPort="443" scheme="https"
```

Also, did you recall of touching your web.xml file? In there you can set some redirect rules, that might be your case.

Best regards,

Felipe Alencastro

comments: author: chris hoerske
body: Okay. I'll try later this evening. Thanks!


author: William Crighton [CCC]
body: Felipe,

That was my first thought when I saw this one unanswered - there was an old, or an absent, proxyName setting in the connector for Confluence tomcat.

The way I learned about this was quite traumatic and managed to sear the troubleshooting step into my central cortex. Nothing quite like going live with a client and after you bring up their new global site it redirect all traffic back to you company's site...

-wc


author: FelipeA
body: Hi Chris,

Please paste here your mod_proxy configuration, along with the server.xml from your Confluence server.

Best regards,

Felipe Alencastro

comments: author: chris hoerske
body: mod_proxy config

#\<IfModule mod_proxy.c\>  
ProxyRequests Off  
ProxyPreserveHost On  
#  
\<Proxy \*\>  
Order deny,allow  
# Deny from all  
Allow from all  
\</Proxy\>  

ProxyPass /confluence [http://host.mydomain.com:8090/confluence\<br\< a=""\>\>ProxyPassReverse /confluence](http://host.mydomain.com:8090/confluence%3Cbr)[http://host.mydomain.com:8090/confluence\<br\< a=""\>\>ProxyPass /jira](http://host.mydomain.com:8090/confluence%3Cbr)[http://host.mydomain.com:8080/jira\<br\< a=""\>\>ProxyPassReverse /jira](http://host.mydomain.com:8080/jira%3Cbr)[http://host.mydomain.com:8080/jira\<br\< a=""\>\>
<br />
\<Location /confluence\>
Order allow,deny
Allow from all
\</Location\>](http://host.mydomain.com:8080/jira%3Cbr)
[My Apache install has a dedicated SSL.conf file.. Now sure if I need the below in my httpd.conf. It was added when I thought SSL was configured in HTTPD.conf
NameVirtualHost \*:443](http://host.mydomain.com:8080/jira%3Cbr)


author: chris hoerske
body: Confluence server.xml

\<Server port="8000" shutdown="SHUTDOWN" debug="0"\>  
\<Service name="Tomcat-Standalone"\>  
\<Connector className="org.apache.coyote.tomcat4.CoyoteConnector" port="8090" minProcessors="5"  
maxProcessors="75"  
enableLookups="false" redirectPort="8443" acceptCount="10" debug="0" connectionTimeout="20000"  
useURIValidationHack="false" URIEncoding="UTF-8" /\>  

\<Engine name="Standalone" defaultHost="localhost" debug="0"\>  

\<Host name="localhost" debug="0" appBase="webapps" unpackWARs="true" autoDeploy="false"\>  

\<Context path="/confluence" docBase="../confluence" debug="0" reloadable="true" useHttpOnly="true"\>  
\<!-- Logger is deprecated in Tomcat 5.5. Logging configuration for Confluence is specified in confluence/WEB-INF/classes/log4j.properties --\>  
\<Manager pathname="" /\>  
\</Context\>  
\</Host\>  

\</Engine\>  

\<!--  
To run Confluence via HTTPS:  
\* Uncomment the Connector below  
\* Execute:  
%JAVA_HOME%\\bin\\keytool -genkey -alias tomcat -keyalg RSA (Windows)  
$JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA (Unix)  
with a password value of "changeit" for both the certificate and the keystore itself.  
\* Restart and visit [https://localhost:8443/\<br\< a=""\>\>
For more info, see](https://localhost:8443/%3Cbr)[http://confluence.atlassian.com/display/DOC/Adding+SSL+for+Secure+Logins+and+Page+Security\<br\< a=""\>\> --\>
\<Connector port="8090" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" disableUploadTimeout="true"
acceptCount="100" URIEncoding="UTF-8" proxyName="host.mydomain.com" proxyPort="443" scheme="https" /\>
\</Service\>
\</Server\>
<br />](http://confluence.atlassian.com/display/DOC/Adding+SSL+for+Secure+Logins+and+Page+Security%3Cbr)
[](http://confluence.atlassian.com/display/DOC/Adding+SSL+for+Secure+Logins+and+Page+Security%3Cbr)


author: chris hoerske
body: Does anyone have any suggestions? It still doesn't work. When trying to access confluence via HTTPS it redirects to HTTP. My JIRA install works perfectly.


Tags: confluence-administration