I have a nextcloud installation behind an haproxy - accessing nextcloud is very performant except for the response to the login http post. With default timeouts I get a 504 Gateway time out at the 30 second point. When I increase the timeout over 30 seconds login is successful and everything is speedy following that. If I reduce the timeout to 5 seconds in haproxy and relogin I receive the 504 Gateway time out at the 5 second point but tailing the apache access log on the back end I only see the POST hit the log at the 30 second point.
Does anyone have a suggestion where to point me?