skip to Main Content

How do I modify this line of Nginx config to allow my website to serve and execute in-line Web-Assembly (wasm)?

add_header Content-Security-Policy   "default-src 'self' http: https: ws: wss: data: blob: 'unsafe-inline'; frame-ancestors 'self';" always;

Error Message:

Content Security Policy: The page’s settings blocked the loading of a resource at wasm-eval (“default-src”).

So, I basically just tried adding wasm-eval to my CSP, right before where it says 'unsafe-inline', but that didn’t work. How do I edit my CSP Header to allow inline Web Assembly (wasm)?

2

Answers


  1. Chosen as BEST ANSWER

    Not the best solution, but one solution is to add 'unsafe-eval' to my CSP. So now the entire line of config looks like this:

    add_header Content-Security-Policy   "default-src 'self' http: https: ws: wss: data: blob: 'unsafe-inline' 'unsafe-eval'; frame-ancestors 'self';" always;
    

    The above works, but maybe isn't great for security. Hopefully I can further update this question/answer in the future.


Please signup or login to give your own answer.
Back To Top
Search