To ensure that your changes are correct, strongly recommended that you use
Code Block |
---|
apachectl -t |
to checck your configuration changes for errors. After this passes, you may need to reload Apache to make sure your changes are applied by running the command
Code Block |
---|
sudo service httpd restart |
To avoid CORS errors, following configs needs to be added at the end to fully CORS-enable an Apache web server in <Directory>, <Location>, <Files>, <VirtualHost> of /etc/httpd/conf/httpd.conf or .htaccess
Code Block |
---|
<IfModule mod_headers.c> Header set Access-Control-Allow-Origin "http://127.0.0.1:3000" *" Header set Access-Control-Allow-OriginHeaders "http://127.0.0.1" Header set Access-Control-Max-Age "300" *" Header set Access-Control-Allow-CredentialsMethods "true" Header set Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept" Header set Access-Control-Allow-Methods "POST, GET, PUT, DELETE, PATCH, OPTIONS" </IfModule>*" |
To ensure that your changes are correct, strongly recommended that you use
Code Block |
---|
apachectl -t |
to checck your configuration changes for errors. After this passes, you may need to reload Apache to make sure your changes are applied by running the command
Code Block |
---|
sudo service httpd restart |
To test if your server has no issue associated with CORS, please visit http://www.test-cors.org