# Support for Adding Custom HTTP Response Headers (HSTS) in Janus WebRTC Server

**URL:** <https://janus.discourse.group/t/support-for-adding-custom-http-response-headers-hsts-in-janus-webrtc-server/1774>\
**Category:** General\
**Created:** [March 11, 2026, 10:59am UTC](https://janus.discourse.group/t/support-for-adding-custom-http-response-headers-hsts-in-janus-webrtc-server/1774 "2026-03-11T10:59:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rohit](https://avatars.discourse-cdn.com/v4/letter/r/41988e/32.png) [@Rohit](https://janus.discourse.group/u/Rohit)\
**Post date:** [March 11, 2026, 10:59am UTC](https://janus.discourse.group/t/support-for-adding-custom-http-response-headers-hsts-in-janus-webrtc-server/1774/1 "2026-03-11T10:59:25Z")

</div>

We have **Janus WebRTC Server deployed** behind HTTPS and performing a security assessment from the security team.

During the vulnerability scan, the following issue was identified:

**HSTS Missing From HTTPS Server (RFC 6797)**

The scan indicates that the server does not return the **Strict-Transport-Security** header in HTTPS responses, which is recommended by **RFC 6797** to enforce secure connections and prevent protocol downgrade attacks.

Example header expected:

```auto
Strict-Transport-Security: max-age=31536000; includeSubDomains

```

From my review of the configuration and documentation, it appears that **Janus currently does not provide a built-in mechanism to add custom HTTP response headers** to responses generated by the internal web server.

Because of this limitation, it is difficult to implement **HSTS compliance directly within Janus** , which may cause security scanners to flag the service.

### Questions

1. Is there any supported way to add custom HTTP headers (such as `Strict-Transport-Security`) in the built-in Janus HTTP/HTTPS server?

2. If not, is this feature planned for future releases?

3. Is the recommended approach to place Janus behind a reverse proxy (e.g., Nginx/Apache) and add the HSTS header there?

Any guidance from the community or maintainers would be appreciated.

---

<div class="post-metadata">

**Author:** ![lorenzo](https://yyz2.discourse-cdn.com/free1/user_avatar/janus.discourse.group/lorenzo/32/425_2.png) [@lorenzo](https://janus.discourse.group/u/lorenzo)\
**Post date:** [March 13, 2026, 2:26am UTC](https://janus.discourse.group/t/support-for-adding-custom-http-response-headers-hsts-in-janus-webrtc-server/1774/2 "2026-03-13T02:26:53Z")

</div>

This was brought up by someone else already. As we told them, we’re not planning to do that, for a few different reasons:

1. We don’t recommend enabling the HTTPS support in the Janus HTTP plugin itself. You should just keep HTTP there, and delegate HTTPS support to a proxy instead (see [docs](https://janus.conf.meetecho.com/docs/deploy)). This keeps Janus lighter, and ensures you leave HTTPS and HTTP stuff to a component that’s much better equipped than our tiny integrated web server.
2. Anything we add to the HTTP plugin should be added to the WebTransport plugin for the same reason. While I think tinkering with headers should be relatively easy with libmicrohttpd, I think it’s harder in libwebsockets. But again, we always recommend proxying the WebSocket API too, so that HTTPS termination is left to more robust components (like nginx or httpd).
