1, how do I get Apache to support cross-domain access ?
Steps:
- Modify the corresponding directory in the httpd.conf,windows is: C:\wamp\bin\apache\Apache2.4.4\conf\httpd.conf
- Remove LoadModule headers_module modules/mod_headers.so in front of the note
- Modify
Switch
namely:
<Directory />
AllowOverride none
Require all granted
Header set Access-Control-Allow-Origin *
</Directory>
(1) First use the graphical interface to open the Headers_module module function; (2) then modify the httpd.conf configuration file, add header set Access-control-allow-origin * sequence is wrong to start the httpd service
2, how to make Nginx support cross-domain ? 1, enter the Nginx HTML directory vim. /crossdomain.xml Specific path:/usr/local/nginx/html/crossdomain.xml 2, added in Crossdomain.xml:
<?xml version= "1.0" encoding= "UTF-8"?>
<! DOCTYPE cross-domain-policy SYSTEM "HTTP://WWW.ADOBE.COM/XML/DTDS/CROSS-DOMAIN-POLICY.DTD" >
<cross-domain-policy>
<allow-access-from domain= "*"/>
</cross-domain-policy>
The result is:
Note: The default/usr/local/nginx/html/crossdomain.xml is not present.
Apache and Nginx support cross-domain access