1

Getting error Uncaught EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "default-src 'self' http: https: data: blob: 'unsafe-inline'".

When trying to load wordpress admin add post in nginx server.

1
  • Please provide enough code so others can better understand or reproduce the problem.
    – Community Bot
    Dec 23, 2021 at 5:00

1 Answer 1

2

Add following line in your nginx configuration file

add_header Content-Security-Policy "default-src 'self' https: data: 'unsafe-inline' 'unsafe-eval'" always;

1
  • 3
    This is a way to basically disable CSP and getting no additional security.
    – lapo
    Aug 9, 2022 at 13:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.