nginx version 1.11.3 Using the following configuration, verification is invalid and cross-domain problems still exist add_header 'Access-Control-Allow-Origin' '*'; add_header 'Access-Control-Allow-Credentials' 'true'; add_header 'Access-Control-Allow-Methods' 'GET,POST'; Use the following configuration to take effect. if ($request_method = 'OPTIONS') { add_header 'Access-Control-Allow-Origin' '*'; add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type'; add_header 'Access-Control-Max-Age' 1728000; add_header 'Content-Type' 'text/plain charset=UTF-8'; add_header 'Content-Length' 0; return 204; } if ($request_method = 'POST') { add_header 'Access-Control-Allow-Origin' '*'; add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type'; } if ($request_method = 'GET') { add_header 'Access-Control-Allow-Origin' '*'; add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type'; } Summarize The above is the full content of this article. I hope that the content of this article will have certain reference learning value for your study or work. Thank you for your support of 123WORDPRESS.COM. If you want to learn more about this, please check out the following links You may also be interested in:
|
<<: Using front-end HTML+CSS+JS to develop a simple TODOLIST function (notepad)
>>: MySQL 5.7.18 zip version installation and configuration method graphic tutorial (win7)
Prerequisite: Save the .frm and .ibd files that n...
Table of contents design Component Communication ...
emmm the name is just a random guess 2333 Preface...
The mini program collected user personal informat...
1. Force no line break and end with an ellipsis. C...
In the process of using Vue to develop projects, ...
Table of contents nonsense text The first router/...
This article shares with you how to install Kylin...
Reference: MySQL character set summary utf8mb4 ha...
I'm currently learning about front-end perform...
A friend in the group asked a question before, th...
Nowadays we often talk about Web2.0, so what is W...
The google.html interface is as shown in the figur...
Table of contents Preface condition Install Docke...
1. Usage of instanceof instanceof operator is use...