rewrite and mod proxy does not work with confluence/jira

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

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=""

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

ProxyRequests Off
ProxyPreserveHost On

<Proxy *>

Require all granted

ProxyPass /confluence
ProxyPassReverse /confluence

<Location /confluence>

Require all granted


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

looking forward to your answer
thanks and
All the best

1 answer

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;
   Atlassian JIRA Standalone Edition Tomcat Configuration.

   See the following for more information
  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
  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  See the License for the specific language governing permissions and
  limitations under the License.
&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="" /&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
    &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
    &lt;Service name="Catalina"&gt;
        &lt;Connector port="8090"
        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
             * Restart and visit https://localhost:8443/
             For more info, see :
            &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"

         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 :
              &lt;Connector port="8009" redirectPort="8443" enableLookups="false" protocol="AJP/1.3" URIEncoding="UTF-8"/&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;

                     Note, you no longer configure your database driver or connection parameters here.
                     These are configured through the UI during application setup.
                    &lt;Resource name="UserTransaction" auth="Container" type="javax.transaction.UserTransaction"
                              factory="org.objectweb.jotm.UserTransactionFactory" jotm.timeout="60"/&gt;
                    &lt;Manager pathname=""/&gt;
                 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 :
        1243466536012x12x1 admin [28/May/2009:09:22:17 +1000] "GET /jira/secure/admin/jira/IndexProgress.jspa?taskId=1 HTTP/1.1" 200 24267 1070 "" "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/2009042523 Ubuntu/9.04 (jaunty) Firefox/3.0.10" "C2C99B632EE0F41E90F8EF7A201F6A78"
                 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 for more information on Tomcat Access Log Valves
            &lt;Valve className="org.apache.catalina.valves.AccessLogValve"
                   pattern="%a %{}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;%{}r&amp;quot;"/&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)

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?

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

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Dec 18, 2018 in Confluence Cloud

Happy holidays from our team to yours!

Hi Community!  2018 was filled with changes for our team, both big and small, and we've taken a lot of time to both celebrate our wins and recognize areas of improvement. One thing that we're a...

475 views 3 18
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you