# Website brings a StatusCode: 503 after a couple of minutes

**URL:** <https://discourse.haproxy.org/t/website-brings-a-statuscode-503-after-a-couple-of-minutes/7307>\
**Category:** Help!\
**Created:** [January 19, 2022, 1:03pm UTC](https://discourse.haproxy.org/t/website-brings-a-statuscode-503-after-a-couple-of-minutes/7307 "2022-01-19T13:03:51Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![cjs1976](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.haproxy.org/cjs1976/32/1613_2.png) [@cjs1976](https://discourse.haproxy.org/u/cjs1976)\
**Post date:** [January 19, 2022, 1:03pm UTC](https://discourse.haproxy.org/t/website-brings-a-statuscode-503-after-a-couple-of-minutes/7307/1 "2022-01-19T13:03:51Z")

</div>

Hi, I have a haproxy reverse proxy because I have only one ip address for multiple servers. So far everything runs fine with the standards I found on the internet. There is only one webserver (zammad with nginx webserver) which is giving some troubles.

I can login and work with the system, but after a couple of minutes or if I make a browser refresh, I get a popup with the following infomration:

* * *

StatusCode: 503

```auto
<html><body><h1>503 Service Unavailable</h1>
No server is available to handle this request.
</body></html>

```

* * *

If I press OK multiple times, I can keep on working.

Thanks for any ideas.

Christian.

---

<div class="post-metadata">

**Author:** ![rhada](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.haproxy.org/rhada/32/585_2.png) [@rhada](https://discourse.haproxy.org/u/rhada)\
**Post date:** [January 20, 2022, 1:22pm UTC](https://discourse.haproxy.org/t/website-brings-a-statuscode-503-after-a-couple-of-minutes/7307/2 "2022-01-20T13:22:32Z")

</div>

Hello,

Is the backend server going down on Haproxy stats page or in logfile when you get the error ?

The 503 error is commonly used when there is no valable backend. So check your health check config and have a look on the log files. You should be able to find the reason of theses errors.

---

<div class="post-metadata">

**Author:** ![cjs1976](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.haproxy.org/cjs1976/32/1613_2.png) [@cjs1976](https://discourse.haproxy.org/u/cjs1976)\
**Post date:** [January 20, 2022, 3:52pm UTC](https://discourse.haproxy.org/t/website-brings-a-statuscode-503-after-a-couple-of-minutes/7307/3 "2022-01-20T15:52:30Z")

</div>

Hi,

in the stats page all servers are green, so I checked the haproxy.log (sudo grep-E ‘NOSRV.+503’ /var/log/haproxy.log):

Jan 20 16:38:18 HAPROXY01 haproxy[608]: 127.0.0.1:52884 [20/Jan/2022:16:38:18.939] stats stats/ 0/-1/-1/-1/0 503 221 - - SC-- 7/1/0/0/0 0/0 “GET /favicon.ico HTTP/1.1”  
Jan 20 16:38:32 HAPROXY01 haproxy[608]: 192.168.20.18:52455 [20/Jan/2022:16:38:27.685] http\_in~ support/ 0/5001/-1/-1/5001 503 221 - - sQ-- 7/7/45/0/0 0/53 “GET [https://help.domain.com/api/v1/ticket\_attachment/1045/4140/7549?view=preview](https://help.domain.com/api/v1/ticket_attachment/1045/4140/7549?view=preview) HTTP/2.0”

There should be an error in my configuration, but I can’t find it…

---

<div class="post-metadata">

**Author:** ![cjs1976](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.haproxy.org/cjs1976/32/1613_2.png) [@cjs1976](https://discourse.haproxy.org/u/cjs1976)\
**Post date:** [January 21, 2022, 2:03pm UTC](https://discourse.haproxy.org/t/website-brings-a-statuscode-503-after-a-couple-of-minutes/7307/4 "2022-01-21T14:03:43Z")

</div>

Hi,  
I was able with htop and hatop to find out, that the zammad server is a bit slow. I added already more ressources and optimized some timeouts ([Optimizing HAProxy for security and performance by tuning timeouts - deltablue - the user-friendly paas for everyone](https://delta.blue/blog/haproxy-timeouts)) and now it’s better but not a 100%.  
Is there a working solution to tell HAProxy to be more patient but only with this server?  
Thanks,  
Christian.

---

<div class="post-metadata">

**Author:** ![rhada](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.haproxy.org/rhada/32/585_2.png) [@rhada](https://discourse.haproxy.org/u/rhada)\
**Post date:** [January 24, 2022, 9:38am UTC](https://discourse.haproxy.org/t/website-brings-a-statuscode-503-after-a-couple-of-minutes/7307/5 "2022-01-24T09:38:22Z")

</div>

You can set timeout to the backend section to only match these servers. I don’t know if it’s possible to set up different timeout per server in backend section.

---

<div class="post-metadata">

**Author:** ![rhada](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.haproxy.org/rhada/32/585_2.png) [@rhada](https://discourse.haproxy.org/u/rhada)\
**Post date:** [February 10, 2022, 11:31am UTC](https://discourse.haproxy.org/t/website-brings-a-statuscode-503-after-a-couple-of-minutes/7307/6 "2022-02-10T11:31:09Z")

</div>

Hello @cjs1976

Just a read that you can set specific timeout for server with [haproxy 2.4](https://www.haproxy.com/blog/announcing-haproxy-2-4/#dynamic-server-timeouts) :

You can use a map file :

```auto
# host.map
www.example.com 3000
api.example.com 1000
websockets.example.com 60000

```

And this config :

```auto

frontend fe_main
  http-request set-timeout server req.hdr(host),map_int(host.map)

```

This way you have different timeout per server.
