Skip to content

Instantly share code, notes, and snippets.

@xiongxin
Created August 23, 2018 03:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xiongxin/6c129fcd862f11135c46466c3c90aa2b to your computer and use it in GitHub Desktop.
Save xiongxin/6c129fcd862f11135c46466c3c90aa2b to your computer and use it in GitHub Desktop.
apache httpd 跨域配置
<VirtualHost *:88>
ServerAdmin support@eccang.com
#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