Setting up confluence with HAProxy

I would like to setup Confluence with HAProxy, but am unsure how to start.  Has anyone done this or have any examples to follow?  I currently have 1 server running confluence.

1 answer

Has anyone managed to get this working? I have a basic configuration working, but it appears to have broken WebSudo...

 

global

    log         127.0.0.1 local2

    chroot      /var/lib/haproxy

    pidfile     /var/run/haproxy.pid

    maxconn     10000

    user        root

    group       root

    daemon

    tune.ssl.default-dh-param 2048

    stats socket /var/lib/haproxy/stats


defaults

    mode                    http

    log                     global

    option                  httplog

    option                  dontlognull

    option http-server-close

    option forwardfor       except 127.0.0.0/8

    option                  redispatch

    retries                 3

    timeout http-request    10s

    timeout queue           1m

    timeout connect         10s

    timeout client          1m

    timeout server          1m

    timeout http-keep-alive 10s

    timeout check           10s

    maxconn                 10000

  

    stats enable

    stats uri /proxy-stats

    stats realm HAproxy\ Statistics

    stats auth user:pass


frontend  confluence_web_insecure

    bind *:80

    redirect scheme https if !{ ssl_fc }

 

frontend confluence_web_secure

    mode http

    bind *:443 ssl crt /foo.pem

    reqadd X-Forwarded-Proto:\ https

    reqadd X-Forwarded-Port:\ 443

    default_backend confluence_app

 

backend confluence_app

    option httplog

    option forwardfor

    option http-server-close

    option httpchk

    mode        http

    balance     roundrobin

    cookie      JSESSIONID prefix indirect nocache

    server node01 foo1.bar.baz ssl verify none cookie s1

    server node02 foo2.bar ssl verify none cookie s2



Hi, 

take a look at this confluence knowledgebase article: 

https://confluence.atlassian.com/confkb/websudo-login-issues-with-haproxy-829068354.html 

If you remove the parameter "indirect" in cookies options the problem should be solved. For me it worked fine :-) 

Best regards 

Alex

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Friday in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

296 views 11 10
Join discussion

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