# Nextcloud behind haproxy - login post delayed 30s

**URL:** <https://discourse.haproxy.org/t/nextcloud-behind-haproxy-login-post-delayed-30s/2473>\
**Category:** Help!\
**Created:** [May 9, 2018, 4:58am UTC](https://discourse.haproxy.org/t/nextcloud-behind-haproxy-login-post-delayed-30s/2473 "2018-05-09T04:58:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dselb](https://avatars.discourse-cdn.com/v4/letter/d/35a633/32.png) [@dselb](https://discourse.haproxy.org/u/dselb)\
**Post date:** [May 9, 2018, 4:58am UTC](https://discourse.haproxy.org/t/nextcloud-behind-haproxy-login-post-delayed-30s/2473/1 "2018-05-09T04:58:35Z")

</div>

Hello,

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?

Thanks.

---

<div class="post-metadata">

**Author:** ![lukastribus](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@lukastribus](https://discourse.haproxy.org/u/lukastribus)\
**Post date:** [May 9, 2018, 7:04am UTC](https://discourse.haproxy.org/t/nextcloud-behind-haproxy-login-post-delayed-30s/2473/2 "2018-05-09T07:04:50Z")

</div>

Can you provide the haproxy log (in httplog format) when this timeout occurs?

---

<div class="post-metadata">

**Author:** ![dselb](https://avatars.discourse-cdn.com/v4/letter/d/35a633/32.png) [@dselb](https://discourse.haproxy.org/u/dselb)\
**Post date:** [May 10, 2018, 4:28am UTC](https://discourse.haproxy.org/t/nextcloud-behind-haproxy-login-post-delayed-30s/2473/3 "2018-05-10T04:28:54Z")

</div>

Thanks for the reply. Apology if I am not giving you the log entry in the format you are requesting, I am not too familiar with the package and am grabbing these from syslog. I am running using a pfsense plugin. Log entry 1 is when I have a timeout for the backend set at 5 seconds to trigger the quick timeout, the second below is when I have the timeout set to 31 seconds to “make it work”. For the first entry I have found the following context for the sH on stackoverflow.  
s: the server-side timeout expired while waiting for the server to send or receive data.  
H: the proxy was waiting for complete, valid response HEADERS from the server (HTTP only).

Thanks again for your time.

May 9 22:15:25 gatewayhost haproxy[78342]: internalip:58638 [09/May/2018:22:14:55.202] example\_multipledomains-merged~ ocdirect\_be\_http\_ipvANY/ulutil 0/0/1/-1/30007 504 194 - - sH-- 0/0/0/0/0 0/0 “POST /index.php/login HTTP/1.1”

May 9 22:19:54 gatewayhost haproxy[17336]: internalip:58752 [09/May/2018:22:19:23.542] example\_multipledomains-merged~ ocdirect\_be\_http\_ipvANY/ulutil 0/0/0/30703/30736 303 669 - - ---- 1/1/0/1/0 0/0 “POST /index.php/login HTTP/1.1”
