Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,456,571
Community Members
 
Community Events
176
Community Groups

Unable to edit Confluence pages using HAProxy configuration

Good day,

We are currently migrating our Confluence instance from IP to hostname; however, we are unable to edit pages due to this error:

error.png

 

We suspect that it has something to do with Synchrony and its configuration mapping with HAProxy. In our previous IP instance, we used nginx with this configuration:

location /confluence {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://confluence_web:8090;
}

location /synchrony {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://confluence_web:8091;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
}

Everything works fine, but after migrating to HAProxy, even though Confluence is accessible using the DNS, we experienced editing issues as seen in the screenshot above. Our current haproxy.cfg configuration looks like this:

backend confluence_server
mode http
balance source
option forwardfor

server confluence 107.105.134.53:8090 check


backend synchrony_server
mode http
balance source
option forwardfor

server synchrony 107.105.134.53:8091 check

We are unsure if we converted the configurations properly. We already modified our server.xml located in confluence-server/confluence_install/conf which looks like this:

<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="http" proxyName="mycompany.com" proxyPort="80" />

We deployed the Confluence service using docker-compose and already exposed both 8090 and 8091 ports in our config file.

Any help is appreciated. Thank you. 

3 answers

1 accepted

1 vote
Answer accepted

It looks like you're running on Server, so I'll assume you have Synchrony and Confluence running on the same server.  I'll also assume you are running a version later than 6.2. Earlier versions of Confluence 6 Collaborative Editing worked differently than modern versions, so if you are running 6.0 or 6.1, save yourself some hassle and upgrade to the latest version.

In your HAproxy config, you are setting a context for Confluence. This will make your URL look like:

http://confluence.domain.com/confluence/display/SPACE/Page+Name

You are also calling a context for Synchrony, which will make the Synchrony traffic go to: 

http://confluence.domain.com/synchrony/heartbeat

Since you have a Confluence Context, you need the Synchrony traffic to go to:

http://confluence.domain.com/confluence/synchrony/heartbeat

In modern versions of Confluence, you don't need to do anything special with Synchrony any more, as Tomcat proxies it. Furthermore, there really is no good reason to run a Confluence Context with HAproxy sitting ahead of Confluence. 

Try this setting and get rid of the Synchrony settings:

location / {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://confluence_web:8090;
}

Thank you for your quick response. Unfortunately, we are using Confluence 6.0 and it worked fine with the synchrony path using nginx. But we need to migrate to a hotsname url which entails using HAProxy, but the config above does not work.

I also checked http://domain.com/synchrony/heartbeat, it returned "Ok", but we're still experiencing the same editing issues.

It should work if you remove the context from the HAproxy config.

location / {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://confluence_web:8090;
}

location /synchrony {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://confluence_web:8091;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
}

Our domain name hosts several services so we need to have /confluence as its context. As of now, we temporarily set collaborative editing to limited since we are having problems with Synchrony. 

@Dave Theodore _Coyote Creek Consulting_ 

your comments have location stanzas for nginx, not haproxy.

We too need to know if this route can work w/o any proxy running locally on the confluence server:

Web --> Haproxy server --> Confluence server:8080

We do not run any proxy (apache, nginx, etc) on the confluence server.  And Synchrony is running under the confluence pid, not standalone.

We do have this in confluence.cfg.xml, and i'm wondering if it should be set to False because we're not proxying 8081 anywhere:

 <property name="synchrony.proxy.enabled">true</property>

 

thanks!

I have the exact same problem with Confluence. It first worked fine through nginx but I had to re-route the traffic through our HaProxy loadbalancers and now we have two problems:

  • Very slow loading pages
  • Publishing/editing pages either fails or takes a long time. If it fails it can take up to 5 tries before it suddenly works again.

All other traffic routed through HaProxy works fine. It feels like the websocket connections aren't setup properly sometimes.

backend docs
balance roundrobin
mode http
option forwardfor
server docker-ams7-01 10.100.20.17:8092 check

Port 8092 is an external Docker port which goes to internal port 8090

you should't use docker 

Your dumb reply doesn't help anyone.

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events