# Haproxy Header Security

**URL:** <https://discourse.haproxy.org/t/haproxy-header-security/12104>\
**Category:** Help!\
**Created:** [December 29, 2025, 10:24am UTC](https://discourse.haproxy.org/t/haproxy-header-security/12104 "2025-12-29T10:24:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![igor](https://avatars.discourse-cdn.com/v4/letter/i/dec6dc/32.png) [@igor](https://discourse.haproxy.org/u/igor)\
**Post date:** [December 29, 2025, 10:24am UTC](https://discourse.haproxy.org/t/haproxy-header-security/12104/1 "2025-12-29T10:24:23Z")

</div>

Hi,

According to the recent third-party penetration test report, we received findings regarding some missing security headers.

Is this something we need to fix at the load balancer level, and if so, is there a guide available that we can review?

We had these findings:

Content Security Policy (CSP) Header Not Set

Multiple X-Frame-Options Header Entries

Missing Anti-clickjacking Header

X-Content-Type-Options Header Missing

Thanks,

Igor

---

<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:** [December 29, 2025, 10:28am UTC](https://discourse.haproxy.org/t/haproxy-header-security/12104/2 "2025-12-29T10:28:00Z")

</div>

You can use:

[http-response add-header](https://docs.haproxy.org/3.0/configuration.html#4-add-header)

or  
[http-response set-header](https://docs.haproxy.org/3.0/configuration.html#4-set-header)

---

<div class="post-metadata">

**Author:** ![igor](https://avatars.discourse-cdn.com/v4/letter/i/dec6dc/32.png) [@igor](https://discourse.haproxy.org/u/igor)\
**Post date:** [December 29, 2025, 10:36am UTC](https://discourse.haproxy.org/t/haproxy-header-security/12104/3 "2025-12-29T10:36:37Z")

</div>

Thanks Lukas,

Do you know also which headers to set and with what parameters?

Igor

---

<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:** [December 29, 2025, 10:45am UTC](https://discourse.haproxy.org/t/haproxy-header-security/12104/4 "2025-12-29T10:45:42Z")

</div>

No, you need to research this based on the requirements of your application, otherwise your application will likely break.

---

<div class="post-metadata">

**Author:** ![AJCxZ0](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.haproxy.org/ajcxz0/32/2482_2.png) [@AJCxZ0](https://discourse.haproxy.org/u/AJCxZ0)\
**Post date:** [January 2, 2026, 2:57am UTC](https://discourse.haproxy.org/t/haproxy-header-security/12104/7 "2026-01-02T02:57:00Z")

</div>

While you can inject HTTP headers with a proxy, these are most likely\* headers which your web service should provide, not your proxy.

You might find the [HTTP Security Response Headers Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/HTTP_Headers_Cheat_Sheet.html) useful.

As @lukastribus says, proceed with care. These are headers you need to set correctly to avoid confusing breakage.

\*[Since we don’t know what you have behind your proxy or how relevant the pen test finding is for your environment, we can’t eliminate the possibility that the proxy is the best place to inject headers.]
