Reverse Proxy with Confluence (apache)

Neil Schulz February 6, 2017

Hello,

I've having an issue with my Confluence trial. In order for us to purchase this,m I need to set up a POC, however, they do not like to type in the port. I set up a reverse proxy, however, it prevents editing.

server.xml file

<Server port="8000" shutdown="SHUTDOWN" debug="0">
    <Service name="Tomcat-Standalone">
<!--        <Connector port="8090" connectionTimeout="20000" redirectPort="8443"
                maxThreads="48" minSpareThreads="10"
                enableLookups="false" acceptCount="10" debug="0" URIEncoding="UTF-8"
                protocol="org.apache.coyote.http11.Http11NioProtocol"/>  -->
        <Connector port="8090"
        maxThreads="48"
        minSpareThreads="10"
        connectionTimeout="20000"
        enableLookups="false"
        maxHttpHeaderSize="8192"
        protocol="org.apache.coyote.http11.Http11NioProtocol"
        useBodyEncodingForURI="UTF-8"
        redirectPort="8443"
        acceptCount="10"
        disableUploadTimeout="true"
        proxyName="confluence-01.domain.com"
        proxyPort="443"
        secure="true"
        scheme="https"/>
        <Engine name="Standalone" defaultHost="localhost" debug="1">
            <Host name="confluence-01.domain.com" debug="0" appBase="webapps" unpackWARs="true" autoDeploy="false" startStopThreads="4">
                <Context path="" docBase="../confluence" debug="0" reloadable="false">
                    <!-- Logger is deprecated in Tomcat 5.5. Logging configuration for Confluence is specified in confluence/WEB-INF/classes/log4j.properties -->
                    <Manager pathname="" />
                    <Valve className="org.apache.catalina.valves.StuckThreadDetectionValve" threshold="60" />
                </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/
             For more info, see https://confluence.atlassian.com/display/DOC/Running+Confluence+Over+SSL+or+HTTPS
        -->
<!--
        <Connector port="8443" maxHttpHeaderSize="8192"
                   maxThreads="150" minSpareThreads="25"
                   protocol="org.apache.coyote.http11.Http11NioProtocol"
                   enableLookups="false" disableUploadTimeout="true"
                   acceptCount="100" scheme="https" secure="true"
                   clientAuth="false" sslProtocols="TLSv1,TLSv1.1,TLSv1.2" sslEnabledProtocols="TLSv1,TLSv1.1,TLSv1.2" SSLEnabled="true"
                   URIEncoding="UTF-8" keystorePass="<MY_CERTIFICATE_PASSWORD>"/>
-->
    </Service>
</Server>

 

Apache file

<VirtualHost *:443>
    ServerName confluence-01.domain.com
        ProxyRequests Off
        <Proxy *>
          Require all granted
        </Proxy>
#        ProxyPass / http://confluence-01.domain.com:8090/
#        ProxyPassReverse / http://confluence-01.domain.com:8090/
        SSLEngine On
        SSLCertificateFile /etc/ssl/certs/cert.pem
        SSLCertificateKeyFile /etc/ssl/private/key.key
       RewriteEngine On
       RewriteCond %{REQUEST_URI} !^/synchrony
       RewriteRule ^/(.*) http://confluence-01.domain.com:8090/$1 [P]
        <Location />
                Require all granted
        </Location>
        ProxyPass /synchrony http://confluence-01.domain.com:8091/synchrony
        <Location /synchrony>
                Require all granted
                RewriteEngine on
                RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC]
                RewriteCond %{HTTP:CONNECTION} Upgrade$ [NC]
                RewriteRule .* ws://confluence-01.domain.com:8091%{REQUEST_URI} [P]
        </Location>
</VirtualHost>
<VirtualHost *:80>
    ServerName confluence-01.domain.com
    Redirect Permanent /  https://confluence-01.domain.com/
    Redirect Permanent /synchrony   https://confluence-01.domain.com/synchrony
</VirtualHost>

 

Any idea what's going on? I receive this error when trying to edit a page.

confluence-err.PNG

 

When I turned off collaborative editing, I had other issues take place, like not being able to see any page templates or when trying to use macros like display child page, it was throw errors.

 

3 answers

0 votes
Sam Hall
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 7, 2017

Did you take a look at either of these?:

It might be worth commenting/asking for help on one or both of those questions, since the people involved seem to have had some success.

Hope you can find someone to help.

Sam

0 votes
Neil Schulz February 7, 2017

Has anyone got this working with Synchrony?

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 6, 2017

You appear to have commented out the proxy lines in the apache config.

Neil Schulz February 6, 2017

The issue occurs both ways. I added in additional rewrites based on another troubleshooting thread. They didn't include the lines at all.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events