Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Issues with Confluence behind an HAProxy

Brian Clark April 9, 2018

We have just recently purchased and installed the Confluence starter pack on a Windows Server 2016.  The initial setup was fairly easy, however we have our confluence behind a HAProxy server, so as soon as I login I get the error that my base URL is incorrect.  I have gone through all the documentation that I can find regarding setting up the "server.xml" to know that it is behind a proxy.  However, whenever I comment out the original, and un-comment the secure, behind a proxy, section, I get a 503 error and cannot connect to confluence any longer.

 

Any help would be greatly appreciated.

1 answer

1 vote
Daniel Eads {unmonitored account}
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.
April 9, 2018

Hey Brian!

There are two things necessary to get Confluence working correctly behind a proxy.

  1. As you noted, server.xml needs to be modified. I wouldn't uncomment the HTTPS connector in server.xml. That section is for having Tomcat terminate SSL, which is something you'd be better off doing in HAProxy. You just need to add schemeproxyName, and proxyPort options to the original connector. For reference, here's a complete connector for use behind a reverse proxy like nginx or HAProxy (swap in your domain name for the proxyName option):
    <Connector port="8090"
           maxThreads="200"
           minSpareThreads="25"
           connectionTimeout="20000"
           enableLookups="false"
           maxHttpHeaderSize="8192"
           protocol="HTTP/1.1"
           useBodyEncodingForURI="true"
           redirectPort="8443"
           acceptCount="100"
           disableUploadTimeout="true"
           scheme="https"
           proxyName="APP.DOMAIN.org"
           proxyPort="443"/>
  2. The baseURL in Confluence itself - this is set from System Administration in the application. Confluence will complain at you if it notices you don't have the same base URL set as what you've got in your reverse proxy setup. Here are simple instructions for setting it.

If you can, doing something like "wiki.yourcompany.com" is going to be less complicated than using a context path ("server.company.com/confluence").

Hope that helped!
Daniel

Brian Clark April 10, 2018

Daniel, 

Thank you for the information.  I have already configured the baseURL as you suggested in #2. 

I just moved my scheme, proxyName, and ProxyPort up to the original section in the server.xml and it seems to have fixed the issue.

thank you for the suggestion.

Brian Clark April 10, 2018

Actually, that is not true, I copied your settings above and replaced the upper section in my server.xml, and replaced scheme, proxyName, and proxyPort with my information and that fixed the issue.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events