CORS header missing ' access-control-allow-origin ' problem

Source: Internet
Author: User

This time encountered Layui cross-domain request problem, on the internet to find a lot of response headers configuration model is not successful

Because the browser has a same-origin policy, if the address of the Layui (including the icon font file) is not in the same domain as your current page address, there will be an icon cross-domain issue. So either you put the Layui on the same server as the Web site, or you add properties to the response headers of the resource server where Layui resides:access-control-allow-origin: *

Because the loaded front file does not know why the configuration is not successful in the CSS

Wrote an Nginx configuration.

Location ~* \. (EOT|TTF|WOFF|SVG|OTF) $ {
Add_header Access-control-allow-origin *;
}

Determine the font file suffix loaded in access-control-allow-origin *;

CORS header missing ' access-control-allow-origin ' problem

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.