Symptoms
-
WordPress website example.com or its Admin Dashboard shows content incorrectly - all icons are shown as a square:
-
The following error can be found in Developer Tool of a Web Browser:
Redirect has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://example.com' is therefore not allowed access.
-
There is the directive in Plesk > Domains > example.com > Apache & nginx Settings > Additional nginx directives:
#location ~ .(ttf|ttc|otf|eot|woff|woff2|font.css)$ {
#add_header Access-Control-Allow-Origin "*";
#}Note: This directive can be completely absent.
Cause
Incorrect nginx directive.
Resolution
-
Go to Plesk > Domains > example.com > Apache & nginx Settings > Additional nginx directives
-
Edit existing directive it should be like:
location ~ .(ttf|ttc|otf|eot|woff|woff2|font.css)$ {
add_header Access-Control-Allow-Origin "*";
}