• The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

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