Created
November 3, 2015 12:15
-
-
Save vrkansagara/65519a881c7353bfb24d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <VirtualHost *:80> | |
| ServerName default | |
| ServerAlias * | |
| DocumentRoot "/var/www/html/public" | |
| # First, let's handle CORS requests | |
| SetEnvIfNoCase Access-Control-Request-Method "(GET|POST|PUT|DELETE|OPTIONS)" IsPreflight=1 | |
| SetEnvIfNoCase Origin "https://(url1.com|url2.com)$" AccessControlAllowOrigin=$0 | |
| Header always set Access-Control-Allow-Origin %{AccessControlAllowOrigin}e env=AccessControlAllowOrigin | |
| Header always set Access-Control-Allow-Methods "GET, POST, PUT, DELETE, OPTIONS" env=IsPreflight | |
| Header always set Access-Control-Allow-Headers "Content-Type, Authorization, Accept" env=IsPreflight | |
| Header always set Access-Control-Max-Age "7200" env=IsPreflight | |
| RewriteEngine On | |
| RewriteCond %{REQUEST_METHOD} OPTIONS | |
| RewriteCond %{ENV:IsPreflight} 1 | |
| RewriteRule ^(.*)$ $1 [R=200,L] | |
| <Directory "/var/www/html/public"> | |
| DirectoryIndex index.php | |
| AllowOverride All | |
| Order allow,deny | |
| Allow from all | |
| RewriteEngine On | |
| RewriteCond %{REQUEST_FILENAME} -s [OR] | |
| RewriteCond %{REQUEST_FILENAME} -l [OR] | |
| RewriteCond %{REQUEST_FILENAME} -d | |
| RewriteRule ^.*$ - [NC,L] | |
| RewriteRule ^.*$ index.php [NC,L] | |
| </Directory> | |
| </VirtualHost> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment