Allow CORS di Server PHP Apache
📅 28 Februari 2023
Edit apache.conf
shell
<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
shell
location / {
add_header Access-Control-Allow-Origin *;
}Enable headers dan rewrite
shell
a2enmod rewrite headers && apache2ctl restartReferensi