# Customize error page by haproxy

**URL:** <https://discourse.haproxy.org/t/customize-error-page-by-haproxy/3894>\
**Category:** Help!\
**Created:** [June 6, 2019, 6:31am UTC](https://discourse.haproxy.org/t/customize-error-page-by-haproxy/3894 "2019-06-06T06:31:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![machihkfyg](https://avatars.discourse-cdn.com/v4/letter/m/6bbea6/32.png) [@machihkfyg](https://discourse.haproxy.org/u/machihkfyg)\
**Post date:** [June 6, 2019, 6:31am UTC](https://discourse.haproxy.org/t/customize-error-page-by-haproxy/3894/1 "2019-06-06T06:31:39Z")

</div>

Hello,

I have experience problem is how to setup customize the error page handle by haproxy. Which need to check the status from backend http server. If the backend http server is return 4XX or 5xx error code. Haproxy can be handle its customized error page.

Thanks All!

---

<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:** [June 6, 2019, 7:05am UTC](https://discourse.haproxy.org/t/customize-error-page-by-haproxy/3894/2 "2019-06-06T07:05:01Z")

</div>

Haproxy does not rewrite error pages of the backend server. You can only customize haproxy own error messages.

---

<div class="post-metadata">

**Author:** ![ciprian.craciun](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.haproxy.org/ciprian.craciun/32/722_2.png) [@ciprian.craciun](https://discourse.haproxy.org/u/ciprian.craciun)\
**Post date:** [June 7, 2019, 7:12am UTC](https://discourse.haproxy.org/t/customize-error-page-by-haproxy/3894/3 "2019-06-07T07:12:36Z")

</div>

I opened the same topic on the HAProxy mailing list:

[https://www.mail-archive.com/haproxy@formilux.org/msg32761.html](https://www.mail-archive.com/haproxy@formilux.org/msg32761.html)

And I’ve even looked through the code to see how it might be implemented, and as it stands today, I would say it is possible, but it is quite an ugly “hack”, which most likely won’t be accepted in upstream. (See the details in my initial email.)
