HAProxy community

HA Proxy and Nextcloud


Hi Guys,

I have three identical Nextcloud servers in operation. A haproxy takes the round robin. In principle everything works, but only almost.

When im surfing the proxy, im reaching one of the server. However, the login does not work. I surf the individual server directly, everything works flawlessly.

I have noticed that when I log on to the proxy and try to log in, it takes a moment and then I redirected to other nextcloud instance. The url chances from:

http://SERVER/index.php/login --> http://SERVER/index.php/login?redirect_url=/index.php/apps/files/


> global
>       # for logging section
>     log local2 info
>     chroot      /var/lib/haproxy
>     pidfile     /var/run/haproxy.pid
>       # process' user and group
>     user        haproxy
>     group       haproxy
>       # makes the process fork into background
>     daemon
> defaults
>         timeout connect 30s
>         timeout client 2h
>         timeout server 2h
> frontend http
>         bind SERVEPROXYR:80
>         default_backend nextcloud_pool
>         reqadd X-Forwarded-Proto:\ http
> backend nextcloud_pool
>         mode http
>         #redirect scheme https if !{ ssl_fc }
>         stats enable
>         stats uri /stats
>         stats realm Haproxy\ Statistics
>         stats auth user:password!
>         balance roundrobin
>         server nxt1 SERVER:80 check
>         server nxt2 SERVER:80 check
>         server nxt3 SERVER:80 check

What i have to do?

Thank you so much!