Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How configure Csp in Nuxt 3?

How do you configure your CSP on Nuxt 3 ? It's the first time i deploy an app online and i'm a bit confused. I try with the module Nuxt/security, it's working but i don't really know how to configure. Is it ok to let 'unsafe-inline' in 'style-src' ? Or 'script-src-attr': ["'none'"],

I read the doc but i don't really know what it's ok or not

like image 416
Kor Avatar asked Oct 22 '25 07:10

Kor


1 Answers

Unfortunately, it is currently not possible to run Nuxt 3 in production without allowing script-src 'unsafe-inline'; and style-src 'unsafe-inline'; in your Content-Security-Policy header.

For reference: The status is tracked in this GitHub discussion https://github.com/nuxt/framework/discussions/4836.

like image 94
Frederik Kammer Avatar answered Oct 26 '25 02:10

Frederik Kammer



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!