rewrite and mod proxy does not work with confluence/jira
Asked by IT Support:

We have an JIRA and a Confluence Instance running on the same server and everything is up and running and listening to port 8080/8090. But we want that the url to connect to the gui is [subdomain.company.de/confluence](http://subdomain.company.de/confluence)  
[subdomain.company.de/JIRA](http://subdomain.company.de/jira)

and also for ssl. but here my port 80 config so far:

I edited the server.xml in /conf/ as described (added contextpath="/confluence"

and in connector added proxyPass="" and proxyName="[subdomain.company.de](http://subdomain.company.de)"  
proxyPort="80"  
scheme="http"

in the apache2 i created a .conf with   
\<Virtualhost \*:80\>

ProxyRequests Off  
ProxyPreserveHost On

\<Proxy \*\>

Require all granted  
\</Proxy\>

ProxyPass /confluence <http://axa.useeds.de:8090/confluence>  
ProxyPassReverse /confluence <http://axa.useeds.com:8090/confluence>

\<Location /confluence\>

Require all granted  
\</Location\>

\</Virtualhost\>

but it is not working so far. can you help me?

looking forward to your answer  
thanks and  
All the best  
Niklas


Answers:
author: Chris Solgat
body: Here's an example of how I typically set my connectors in JIRA (example is from JIRA 7.1.4).

```
&lt;?xml version="1.0" encoding="utf-8"?&gt;&lt;!--   ====================================================================================   Atlassian JIRA Standalone Edition Tomcat Configuration.   See the following for more information   http://confluence.atlassian.com/display/JIRA/Configuring+JIRA+Standalone   ==================================================================================== --&gt;&lt;!--  Licensed to the Apache Software Foundation (ASF) under one or more  contributor license agreements.  See the NOTICE file distributed with  this work for additional information regarding copyright ownership.  The ASF licenses this file to You under the Apache License, Version 2.0  (the "License"); you may not use this file except in compliance with  the License.  You may obtain a copy of the License at      http://www.apache.org/licenses/LICENSE-2.0  Unless required by applicable law or agreed to in writing, software  distributed under the License is distributed on an "AS IS" BASIS,  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the License for the specific language governing permissions and  limitations under the License.--&gt;&lt;Server port="15001" shutdown="SHUTDOWN"&gt;    &lt;Listener className="org.apache.catalina.startup.VersionLoggerListener" /&gt;    &lt;!-- Security listener. Documentation at /docs/config/listeners.html    &lt;Listener className="org.apache.catalina.security.SecurityListener" /&gt;    --&gt;    &lt;!--APR library loader. Documentation at /docs/apr.html --&gt;    &lt;Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" /&gt;    &lt;!-- Prevent memory leaks due to use of particular java/javax APIs--&gt;    &lt;Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" /&gt;    &lt;Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" /&gt;    &lt;Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" /&gt;    &lt;!-- Global JNDI resources         Documentation at /docs/jndi-resources-howto.html    --&gt;    &lt;!-- A "Service" is a collection of one or more "Connectors" that share        a single "Container" Note:  A "Service" is not itself a "Container",        so you may not define subcomponents such as "Valves" at this level.        Documentation at /docs/config/service.html    --&gt;    &lt;Service name="Catalina"&gt;        &lt;Connector port="8090"                   maxThreads="150"                   minSpareThreads="25"                   connectionTimeout="20000"                   enableLookups="false"                   maxHttpHeaderSize="8192"                   protocol="org.apache.coyote.http11.Http11NioProtocol"                   useBodyEncodingForURI="true"                   redirectPort="8500"                   scheme="https"                   proxyName="subdomain.companyname.com"                   proxyPort="443"                   acceptCount="100"                   disableUploadTimeout="true"/&gt;        &lt;!--        ====================================================================================        To run JIRA 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.             * If you are on JDK1.3 or earlier, download and install JSSE 1.0.2 or later, and put the JAR files into               "$JAVA_HOME/jre/lib/ext"             * Restart and visit https://localhost:8443/             For more info, see :              http://confluence.atlassian.com/display/JIRA/Running+JIRA+over+SSL+or+HTTPS              and              http://tomcat.apache.org/tomcat-6.0-doc/ssl-howto.html        ====================================================================================        --&gt;                    &lt;Connector port="8500" protocol="org.apache.coyote.http11.Http11NioProtocol"              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="certalias" keystoreFile="/path/to/certificat/directory/cert.keystore"              keystorePass="keypassword"/&gt;                &lt;!--         ====================================================================================         If you have Apache AJP Connector (mod_ajp) as a proxy in front of JIRA you should uncomment the following connector configuration line         See the following for more information :            http://confluence.atlassian.com/display/JIRA/Configuring+Apache+Reverse+Proxy+Using+the+AJP+Protocol         ====================================================================================        --&gt;        &lt;!--              &lt;Connector port="8009" redirectPort="8443" enableLookups="false" protocol="AJP/1.3" URIEncoding="UTF-8"/&gt;        --&gt;        &lt;Engine name="Catalina" defaultHost="localhost"&gt;            &lt;Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true"&gt;                &lt;Context path="/jira" docBase="${catalina.home}/atlassian-jira" reloadable="false" useHttpOnly="true"&gt;                    &lt;!--                     ====================================================================================                     Note, you no longer configure your database driver or connection parameters here.                     These are configured through the UI during application setup.                     ====================================================================================                    --&gt;                    &lt;Resource name="UserTransaction" auth="Container" type="javax.transaction.UserTransaction"                              factory="org.objectweb.jotm.UserTransactionFactory" jotm.timeout="60"/&gt;                    &lt;Manager pathname=""/&gt;                &lt;/Context&gt;            &lt;/Host&gt;            &lt;!--                ====================================================================================                 Access Logging.                 This should produce access_log.&lt;date&gt; files in the 'logs' directory.                 The output access log lies has the following fields :                 IP Request_Id User Timestamp  "HTTP_Method URL Protocol_Version" HTTP_Status_Code ResponseSize_in_Bytes RequestTime_In_Millis Referer User_Agent ASESSIONID                 eg :                 192.168.3.238 1243466536012x12x1 admin [28/May/2009:09:22:17 +1000] "GET /jira/secure/admin/jira/IndexProgress.jspa?taskId=1 HTTP/1.1" 200 24267 1070 "http://carltondraught.sydney.atlassian.com:8090/jira/secure/admin/jira/IndexAdmin.jspa" "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.10) Gecko/2009042523 Ubuntu/9.04 (jaunty) Firefox/3.0.10" "C2C99B632EE0F41E90F8EF7A201F6A78"                 NOTES:                 The RequestId is a millis_since_epoch plus request number plus number of concurrent users                 The Request time is in milliseconds                 The ASESSIONID is an hash of the JSESSIONID and hence is safe to publish within logs.  A session cannot be reconstructed from it.                 See http://tomcat.apache.org/tomcat-6.0-doc/config/valve.html for more information on Tomcat Access Log Valves                ====================================================================================            --&gt;            &lt;Valve className="org.apache.catalina.valves.AccessLogValve"                   pattern="%a %{jira.request.id}r %{jira.request.username}r %t &amp;quot;%m %U%q %H&amp;quot; %s %b %D &amp;quot;%{Referer}i&amp;quot; &amp;quot;%{User-Agent}i&amp;quot; &amp;quot;%{jira.request.assession.id}r&amp;quot;"/&gt;        &lt;/Engine&gt;    &lt;/Service&gt;&lt;/Server&gt;
```

Make notice that both connectors are setup and both are using the "https" scheme. Also, we tend to stay away from ports like 8080/8090 as well. Reference [Proxying Atlassian server applications with Apache HTTP Server (mod_proxy_http)](https://confluence.atlassian.com/kb/proxying-atlassian-server-applications-with-apache-http-server-mod_proxy_http-806032611.html)

The ProxyPass settings look correct to me, except you may need to use the Server Name or ID (if what you provided wasn't already). Did you remember to enable your mod_proxy as per [Using Apache with mod_proxy -- Simple Configuration](https://confluence.atlassian.com/doc/using-apache-with-mod_proxy-173669.html)?

Also don't forget to restart the Apache server after the configurations have been made.


Tags: confluence-administration