Blocked by CORS policy

Good day.
Can you please inform me what files and path I should modify to activate CORS, I use debian 10 on Linode with shared sites, I tried on a server with a single site and I was able to run syscon32.cl, but here, with several sites running, it does not work. Which configuration files should I modify so that it does not check this in the browser console.

has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

1 Like

Apologies, but I don’t understand where I should put Access-Control-Allow-Origin, eb Hestia, I use Apache, but apparently it also has nginx, so it confuses me.

Additionally, the following appears on the network:

Request URL: https://www.syscon32.cl/Usuarios/validar
Application Method: POST
Status Code: 301 Moved Permanently
Referrer Policy: strict-origin-when-cross-origin.

On another server with Debian11, with apache and no control panel, I was able to get it to work, with the syscon32.cl.conf file.

<virtualhost *:80>
     ServerName syscon32.cl
     ServerAlias www.syscon32.cl
     ServerAdmin [email protected]
     DocumentRoot /var/www/html/syscon32.cl/public_html

     RewriteCond %{SERVER_NAME} =syscon32.cl [OR]
     RewriteCond %{SERVER_NAME} =www.syscon32.cl
     RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
     RewriteCond %{REQUEST_FILENAME} !-d
     RewriteCond %{REQUEST_FILENAME} !-f
     RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]

     <Directory /var/www/html/syscon32.cl/public_html>
         Options -Indexes +FollowSymLinks
         AllowOverride All
         Require all granted
         <IfModule mod_headers.c>
                 Header set Access-Control-Allow-Origin "*"
         </IfModule>
     </Directory>

     ErrorLog ${APACHE_LOG_DIR}/syscon32.cl_error.log
     CustomLog ${APACHE_LOG_DIR}/syscon32.cl_access.log combined

</virtualhost>