• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Issue CORS Header does not apply to site

hello @TheDanniCraft ,

by default Plesk uses nginx as reverse proxy, so additional directives for apache may be not enough
and you need appropriate directives for nginx too (see the same article)
 
I added
Code:
location ~* \.(eot|ttf|woff|woff2)$ {
    add_header Access-Control-Allow-Origin "https://api.thedannicraft.de";
}
to nginnx statements but it doesn't worl
 
@TheDanniCraft , I feel that you should add just custom directive, without location, like on screenshot below
1650506410595.png

on my test machine it looks like below:
$ curl -v heavy02.a10-52-61-134.qa.plesk.com
* Trying 10.52.61.134:80...
* Connected to heavy02.a10-52-61-134.qa.plesk.com (10.52.61.134) port 80 (#0)
> GET / HTTP/1.1
> Host: heavy02.a10-52-61-134.qa.plesk.com
> User-Agent: curl/7.74.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Server: nginx
< Date: Thu, 21 Apr 2022 02:01:18 GMT
< Content-Type: text/html
< Content-Length: 464
< Connection: keep-alive
< X-Accel-Version: 0.01
< Last-Modified: Fri, 15 Apr 2022 04:12:56 GMT
< ETag: "1d0-5dca9a011cd90"
< Accept-Ranges: bytes
< Access-Control-Allow-Origin: http://api.thedannicraft.de
< X-Powered-By: PleskLin
< Access-Control-Allow-Origin: http://api.thedannicraft.de
<
<!doctype html>
<html lang="en">
<head>
 
did you set appropriate nginx additional directives at the bottom of the page:
1650513990524.png
?
 
you should use https://api.thedannicraft.de for the nginx additional directives,
because you have 301 redirect to https turned ON.

also, please check that you're using correct URL for API calls (https://api.thedannicraft.de)
the problem may be caused by setting preferred site setting:

another one reason why web server configuration has not been yet applied may be that Plesk configured to reload web servers not right after some config was changed, but once per some time

manual nginx and apache restart should solve this.


if it does not help, well.. probably it would be better to reach technical support,
so our engineers will be able to investigate this problem more deeper.
 
I have that same problem. I tried restarting it didn't work.
you should use https://api.thedannicraft.de for the nginx additional directives,
because you have 301 redirect to https turned ON.

also, please check that you're using correct URL for API calls (https://api.thedannicraft.de)
the problem may be caused by setting preferred site setting:

another one reason why web server configuration has not been yet applied may be that Plesk configured to reload web servers not right after some config was changed, but once per some time

manual nginx and apache restart should solve this.


if it does not help, well.. probably it would be better to reach technical support,
so our engineers will be able to investigate this problem more deeper.
I have that same problem. I tried restarting it didn't work.
 
Back
Top