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)
For many people who are new to HTML, table <ta...
1. Description Earlier we talked about the instal...
Table of contents Tutorial Series 1. Install Mari...
Table of contents Preface 1. What is scalability?...
Today's campus recruitment written test requi...
1. Spread Operator The spread operator is three d...
Use scenarios: The project's pages need to lo...
1. Introduction Earlier we talked about the front...
Table of contents Overview Hash Properties Host p...
Table of contents Linux--File descriptor, file po...
<br />When inserting music into a web page, ...
Table of contents 1. Write an HTML, the first Vue...
The default request header of the http1.1 protoco...
This article example shares the specific code of ...
Detailed explanation of MySQL sorting Chinese cha...