Wednesday, 13 April 2022

Apach2 Allow CORS

 https://ubiq.co/tech-blog/enable-cors-apache-web-server/#:~:text=By%20default%2C%20cross%20domain%20requests,Origin%20Resource%20Sharing)%20in%20Apache.


sudo a2enmod headers
<VirtualHost *:443>
   ...
   Header add Access-Control-Allow-Origin "*"
   ...
</VirtualHost>

https://stackoverflow.com/questions/10636611/how-does-access-control-allow-origin-header-work

// For sites need to specify ports

Access-Control-Allow-Origin: http://siteA.com 



systemctl restart apache2.service    

No comments:

Post a Comment