Forums

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

Pages with special characters are not accessible via HAProxy

Celine Villafuerte October 15, 2018

Hello,

I am experiencing the same problem as stated in this article:

https://confluence.atlassian.com/confkb/pages-with-special-characters-are-not-accessible-via-reverse-proxy-829664257.html

 

However, I am using HAProxy and I'm sure if this workaround is possible. Our Confluence version is 6.0 and we use /confluence as context path.

server.xml config is as follows:

<Connector port="8090" 
     protocol="org.apache.coyote.http11.Http11NioProtocol"
     connectionTimeout="20000"
     URIEncoding="UTF-8" acceptCount="10"
enableLookups="false" debug="0" redirectPort="443" maxThreads="200" minSpareThreads="10" scheme="https" secure="true" proxyName="mycompany.com" proxyPort="443" />

Current HAProxy config:

backend confluence_server
mode http
http-request set-header X-Forwarded-Host %[req.hdr(host)]
http-request set-header X-Real-IP %[src]
http-request set-header X-Forwarded-Server %[req.hdr(host)]
balance source
option forwardfor except 127.0.0.1 header X-Forwarded-For
server confluence 107.105.134.53:8090 maxconn 10000 weight 10 cookie confluence check

backend synchrony_server
mode http
http-check disable-on-404
http-request set-header X-Forwarded-Host %[req.hdr(host)]
http-request set-header X-Real-IP %[src]
http-request set-header X-Forwarded-Server %[req.hdr(host)]
balance source
option forwardfor
server synchrony 107.105.134.53:8091 maxconn 10000 weight 10 cookie synchrony check

Any help is appreciated, thanks.

1 answer

1 vote
Daniel Eads
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 24, 2018

Hi Celine,

I've not personally used HAProxy or have a test one handy to give this a run. So take this with the proper "untested!" grain of salt. :)

The nginx-specific fix simply parses the URI. Based on what nginx is doing, it seems like the equivalent directive you'll need to set in HAProxy is:

http-request set-uri http://%[req.hdr(Host)]%[path]?%[query]

I'd put this right above the "balance source" line in both your server blocks.

Let me know if this works or not, I'd love to update that KB article for future HAProxy users if you're able to get it patched up!

Cheers,
Daniel 

Celine Villafuerte January 1, 2019

Hi Daniel,

Sorry it took a while to reply. We were not able to fix it using HAProxy, but since Nginx is placed on top of HAProxy in our infra, we just moved the Synchrony configurations to nginx.conf.  HAProxy does not handle websockets well that's why we opted to use the 2 technologies together.

Like Daniel Eads likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events