Created
August 23, 2018 03:33
-
-
Save xiongxin/6c129fcd862f11135c46466c3c90aa2b to your computer and use it in GitHub Desktop.
apache httpd 跨域配置
This file contains 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 *:88> | |
ServerAdmin [email protected] | |
#php_admin_value open_basedir "/data/www/SmartSell:/data/www/SmartSell/public:/tmp/:/var/tmp/:/proc/" | |
DocumentRoot "/data/www/SmartSell/public" | |
ServerName backendstool.eccang.com | |
ErrorLog "/home/wwwlogs/backendstool.eccang.com-error_log" | |
CustomLog "/home/wwwlogs/backendstool.eccang.com-access_log" combined | |
# Always set these headers. | |
Header always set Access-Control-Allow-Origin "*" | |
Header always set Access-Control-Allow-Methods "POST, GET, OPTIONS, DELETE, PUT" | |
Header always set Access-Control-Max-Age "1000" | |
Header always set Access-Control-Allow-Headers "ContentType, x-requested-with,token, name, Content-Type, origin, authorization, accept, client-security-token" | |
Header always set Access-Control-Expose-Headers: "Access-Token, Uid, name" | |
# Added a rewrite to respond with a 200 SUCCESS on every OPTIONS request. | |
RewriteEngine On | |
RewriteCond %{REQUEST_METHOD} OPTIONS | |
RewriteRule ^(.*)$ $1 [R=200,L] | |
<Directory "/data/www/SmartSell/public"> | |
#SetOutputFilter DEFLATE | |
Options Indexes FollowSymLinks | |
AllowOverride All | |
Order allow,deny | |
Allow from all | |
Require all granted | |
DirectoryIndex index.html index.php | |
</Directory> | |
</VirtualHost> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment