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)
This article records the detailed tutorial for in...
px(pixel) I believe everyone is familiar with the...
Docker is becoming more and more popular. It can ...
Preface This article mainly introduces the releva...
Table of contents 1. Template 2. Generics 3. Gene...
Data Sheet: Column to row: using max(case when th...
Preface The language classification of SQL mainly...
Recently, I want to regularly back up important i...
Preface Recently, when working on a high-availabi...
1. Go to Vim's official website to download t...
1. <body background=image file name bgcolor=co...
When configuring the interface domain name, each ...
Recently, when I was sorting out the details of d...
In MySQL 8.0.18, a new Hash Join function was add...
This article shares the installation and configur...