i am working on my own ERP in laravel with a seperate Vue.js Front. I was for a while working on a windows server with apache and it was working fine. The setup was a bit tricky in the beginning as i was not running vue from apache but using npm run dev so using it's own dev server. I was able to build it and tested it while serving it from port 80.
So far so good.
I wanted to go through the motions and do a sample install for production and migrated everything over to centOS and here i'm running into CSRF warnings on the frontend.
In case you are wondering, i have the cors headers enabled on my windows rig, but i did not need to set anything else like this:
Header set Access-Control-Allow-Origin "*"
in the my directory settings which is often advises on here when you run into CSRF preflight issues.
This is the error i get in centOS that i do not get in windows:
Access to XMLHttpRequest at 'http://192.168.2.100:8029/api/oauth/get-token' from origin 'http://192.168.2.100' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: The 'Access-Control-Allow-Origin' header contains multiple values '*, http://192.168.2.100', but only one is allowed.
PS i'm serving laravel on port 8029 served up by apache. I'm listening to both ports 80 and 8029 (vue front end and laravel backend)
Here is the vhost file:
<VirtualHost *:8029>
ServerAdmin emailhere
DocumentRoot "/var/www/html/backendpathhere/"
ServerName webservices7.zeintek.com
ServerAlias www.webservices7.zeintek.com
<Directory "/var/www/html/backendpathhere/">
AddHandler cgi-script .cgi .pl .py
Options Indexes Includes FollowSymLinks ExecCGI
AllowOverride All
Order Allow,Deny
Allow From All
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerAdmin emailhere
DocumentRoot "/var/www/html/frontendpathhere/"
<Directory "/var/www/html/frontendpathhere/">
AddHandler cgi-script .cgi .pl .py
Options Indexes Includes FollowSymLinks ExecCGI
Options +ExecCGI
AllowOverride All
Order Allow,Deny
Allow From All
</Directory>
</VirtualHost>