Allow CORS di Server PHP Apache
Edit apache.conf
<Directory /var/www/html/>
Options -Indexes +FollowSymLinks
AllowOverride All
Allow from All
Require all granted
</Directory>
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
</IfModule>
Jika nginx kurang lebih seperti ini
location / {
add_header Access-Control-Allow-Origin *;
}
Enable headers dan rewrite
a2enmod rewrite headers && apache2ctl restart
Referensi