We are happy to announce that Vesta is back under active development as of 25 February 2024. We are working on v1 candidate and expect to engage more with the community over the coming months. We are committed to open source, and we encourage contributors to help us build the future of Vesta.
How do I add Access-Control-Allow-Origin in vestacp? cors
How do I add Access-Control-Allow-Origin in vestacp? cors
i'm using cdn cloudfront and i have error on browser that my font blocked (Access-Control-Allow-Origin)
please anyone can help me how to fix Access-Control-Allow-Origin in vestacp
i have been trying all methods on google i found but all failed.. what conf should i modify? nginx or apache?
please anyone can help me how to fix Access-Control-Allow-Origin in vestacp
i have been trying all methods on google i found but all failed.. what conf should i modify? nginx or apache?
Re: How do I add Access-Control-Allow-Origin in vestacp? cors
Nginx - /home/user/conf/web/nginx.conf (snginx.conf if you have some)nginx or apache?
Code: Select all
location ~ \.(ttf|ttc|otf|eot|woff|woff2|font.css|css|js)$ {
add_header Access-Control-Allow-Origin "*";
Re: How do I add Access-Control-Allow-Origin in vestacp? cors
all of them don't work..
i have tried the first one several times before and don't work..
the second gives me 404 error..
i have tried the first one several times before and don't work..
the second gives me 404 error..
Re: How do I add Access-Control-Allow-Origin in vestacp? cors
Hi,
I am having exactly the same issue running my VPS with nginx web server/CDN cloudfront. It's diving me crazy because I have already tried most of the suggestions and recommendations I found online but no luck.
Still getting these errors in browsers
Access to Font at 'https://css-files.mydomain.com/wp-conte ... f2?v=4.4.0' from origin 'https://css-files.mydomain.com' has been blocked by CORS policy: The 'Access-Control-Allow-Origin' header contains the invalid value 'mydomain.com'. Origin 'https://mydomain.com' is therefore not allowed access.
Access to Font at 'https://css-files.mydomain.com/wp-conte ... ff?v=4.4.0' from origin 'https://css-files.mydomain.com' has been blocked by CORS policy: The 'Access-Control-Allow-Origin' header contains the invalid value 'mydomain.com'. Origin 'https://mydomain.com' is therefore not allowed access.
And some more
I am currently using
in my home/mydomain/conf/web/snginx.conf
Please help. Any suggestion or hint will be much appreciated.
Thank
I am having exactly the same issue running my VPS with nginx web server/CDN cloudfront. It's diving me crazy because I have already tried most of the suggestions and recommendations I found online but no luck.
Still getting these errors in browsers
Access to Font at 'https://css-files.mydomain.com/wp-conte ... f2?v=4.4.0' from origin 'https://css-files.mydomain.com' has been blocked by CORS policy: The 'Access-Control-Allow-Origin' header contains the invalid value 'mydomain.com'. Origin 'https://mydomain.com' is therefore not allowed access.
Access to Font at 'https://css-files.mydomain.com/wp-conte ... ff?v=4.4.0' from origin 'https://css-files.mydomain.com' has been blocked by CORS policy: The 'Access-Control-Allow-Origin' header contains the invalid value 'mydomain.com'. Origin 'https://mydomain.com' is therefore not allowed access.
And some more
I am currently using
Code: Select all
location ~ \.(ttf|ttc|otf|eot|woff|woff2|font.css|css|js)$ {
add_header Access-Control-Allow-Origin "*";
}
Please help. Any suggestion or hint will be much appreciated.
Thank
-
- Posts: 35
- Joined: Sat Jun 25, 2016 6:56 pm
Re: How do I add Access-Control-Allow-Origin in vestacp? cors
same problem here
Re: How do I add Access-Control-Allow-Origin in vestacp? cors
add
add_header Access-Control-Allow-Origin *;
into /etc/nginx/nginx.conf
restart nginx
invalidate those fonts path
add_header Access-Control-Allow-Origin *;
into /etc/nginx/nginx.conf
restart nginx
invalidate those fonts path
-
- Posts: 12
- Joined: Mon May 01, 2017 8:38 am
Re: How do I add Access-Control-Allow-Origin in vestacp? cors
Facing the same issue! Anyone found a solution to this?
Re: How do I add Access-Control-Allow-Origin in vestacp? cors
(!)
viewtopic.php?f=10&t=10166#p36700
If this don't fit, then please explain, how you test this CORS issue?
viewtopic.php?f=10&t=10166#p36700
If this don't fit, then please explain, how you test this CORS issue?
Re: How do I add Access-Control-Allow-Origin in vestacp? cors
# sudo nano /home/user/conf/web/snginx.conf
Add: add_header Access-Control-Allow-Origin "*";
# sudo service nginx restart
worked for me, also it lack woff2 so you need to add it
Add: add_header Access-Control-Allow-Origin "*";
# sudo service nginx restart
worked for me, also it lack woff2 so you need to add it
Code: Select all
server {
listen ip:443;
server_name cdn.domain.com www.cdn.domain.com;
location / {
proxy_pass https://ip:8443;
location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|tif|tiff|css|js|htm|html|ttf|otf|webp|woff|txt|csv|rtf|doc|docx|xls|xlsx|ppt|pptx|odf|odp|ods|odt|pdf|psd|ai|eot|eps|ps|zip|tar|tgz|gz|rar|bz2|7z|aac|m4a|mp3|mp4|ogg|wav|wma|3gp|avi|flv|m4v|mkv|mov|mpeg|mpg|wmv|exe|iso|dmg|swf|woff2)$ {
add_header Access-Control-Allow-Origin "*";
}
}
}
Re: How do I add Access-Control-Allow-Origin in vestacp? cors
You shouldn't be editing the nginx.conf file directly!!!! Always edit the templates:
Cheers
Andy
Failing to do that, will just cause your changes to get lost the next time you update the account from the CP (and can even cause fatal errors, as the template parser does not recognise the new line you added in)/usr/local/vesta/data/templates/web
Cheers
Andy