• The APS Catalog has been deprecated and removed from all Plesk Obsidian versions.
    Applications already installed from the APS Catalog will continue working. However, Plesk will no longer provide support for APS applications.
  • Please be aware: with the Plesk Obsidian 18.0.78 release, the support for the ngx_pagespeed.so module will be deprecated and removed from the sw-nginx package.

Question Nginx origin setting for CDN cors problem

yunus çetiner

New Pleskian
I'm trying to add a directive on the Plesk panel for nginx, but unfortunately I can't find where to add it. I have a cors problem in fonts with CDN.


Code:
    location ~ \.(ttf|ttc|otf|eot|woff|font.css|css|js|gif|png|jpe?g|svg|svgz|ico|webp)$ {
           add_header Access-Control-Allow-Origin "*";
}

where should I add this code. I can't find any.
 
I'm trying to add a directive on the Plesk panel for nginx, but unfortunately I can't find where to add it. I have a cors problem in fonts with CDN.


Code:
    location ~ \.(ttf|ttc|otf|eot|woff|font.css|css|js|gif|png|jpe?g|svg|svgz|ico|webp)$ {
           add_header Access-Control-Allow-Origin "*";
}

where should I add this code. I can't find any.


Hi yunus çetiner,

That goes inside the section "Apache and nginx configuration" in the section "Additional nginx directives".

Or in its absence in the domain file vhost_nginx.conf
 
i added. after i create cdn. still not work.
0c6c69f592.png

f59d7cd84d.png
 
[QUOTE = "yunus çetiner, post: 856424, miembro: 187498"] Agregué. después de crear cdn. todavia no funciona
0c6c69f592.png

f59d7cd84d.png
[/CITAR]

Have you tried putting it this way?

add_header "Access-Control-Allow-Origin" "*";[/ QUOTE]
 
Last edited:
No, I haven't. In fact, this is exactly how I should add the code there.


Code:
location ~ \.(ttf|ttc|otf|eot|woff|font.css|css|js|gif|png|jpe?g|svg|svgz|ico|webp)$ {
           add_header Access-Control-Allow-Origin "*";
}

Is your code enough?
Code:
add_header 'Access-Control-Allow-Origin' '*';
 
No, I haven't. In fact, this is exactly how I should add the code there.


Code:
location ~ \.(ttf|ttc|otf|eot|woff|font.css|css|js|gif|png|jpe?g|svg|svgz|ico|webp)$ {
           add_header Access-Control-Allow-Origin "*";
}

Is your code enough?
Code:
add_header 'Access-Control-Allow-Origin' '*';

So I see the correct way to put it is with "
add_header "Access-Control-Allow-Origin" "*";
 
Back
Top