---
title: "Discussion on \"HTTP Security Headers and how to set them in Next.js\" | Hashnode"
description: "Discussion on \"HTTP Security Headers and how to set them in Next.js\". Security headers are a type of HTTP header there to help us describe our site so we can help protect it against various potential attacks.\nIn this article, I will introduce HTTP headers including various different security headers that you might want..."
url: "https://hashnode.com/posts/http-security-headers-and-how-to-set-them-in-nextjs/610cfac5b79d6a113667f255"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [HTTP Security Headers and how to set them in Next.js](https://blog.kieranroberts.dev/http-security-headers-and-how-to-set-them-in-nextjs?utm_source=hashnode&utm_medium=feed)

Security headers are a type of HTTP header there to help us describe our site so we can help protect it against various potential attacks. In this article, I will introduce HTTP headers including various different security headers that you might want...

Aug 6, 2021 · 8 min read · blog.kieranroberts.dev  
Read the article

-   [#web-development](https://hashnode.com/tag/web-development)
-   [#javascript](https://hashnode.com/tag/javascript)
-   [#nextjs](https://hashnode.com/tag/nextjs)
-   [#security](https://hashnode.com/tag/security)

## Written by

[Kieran Roberts](https://hashnode.com/@kieran6roberts)

@kieran6roberts · Galway, Ireland

  
[View profile](https://hashnode.com/@kieran6roberts)

Software Engineer | Ex Hashnode

## Responses 1

Markdown supported · ⌘↵ to post

[David Bekham](https://hashnode.com/@davidc87)

[Oct 14, 2022](https://hashnode.com/posts/http-security-headers-and-how-to-set-them-in-nextjs/610cfac5b79d6a113667f255/comment/63498af4f54817496976ee2f)

Hello Kieran,

I just implemented the CSP using the same format and Next JS shows the CSP headers during the request in the localhost. But if I am running the same code in the Staging or Prod enviornment its not showing up.
