Apache and Nginx support cross-domain access

Source: Internet
Author: User

1, how do I get Apache to support cross-domain access ?
Steps:

    1. Modify the corresponding directory in the httpd.conf,windows is: C:\wamp\bin\apache\Apache2.4.4\conf\httpd.conf
    2. Remove LoadModule headers_module modules/mod_headers.so in front of the note
    3. 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.