Enable CORS in Apache

To enable CORS in apache, add the following in VirtualHost or .htaccess

Header always set Access-Control-Allow-Origin "*"
Header always set Access-Control-Allow-Methods "POST, GET, OPTIONS"

If your apache installation don’t have mod_headers installed, you need it enabled with

a2enmod headers
systemctl restart apache2

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *