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
That
</> noneRequireall granted Headerset Access-Control-Allow-Origin*</Directory>
If you use the graphical interface to open the Headers_module module, note the sequence of steps
(1) First use the graphical interface to open the Headers_module module function;
(2) After modifying the httpd.conf configuration file, add header set Access-control-allow-origin *
If the order is wrong, you can't start 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, add in Crossdomain.xml:
<cross-domain-policy><allow-access-fromdomain="*" />
cross-domain-policy>
The result is:
Note: The default/usr/local/nginx/html/crossdomain.xml is not present.
The above describes the Apache and Nginx support cross-domain access, including aspects of the content, I hope that the PHP tutorial interested in a friend helpful.