• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

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