介绍
- 头添加
Access-Control-Allow-Origin
和Access-Control-Allow-Methods
和Access-Control-Allow-Credentials
指令
addheader | Syntax: |
**add_header**
_name`_value_
[always
];| | :--- | --- | | Default: | — | | Context: |
http,
server,
location,
if in location` |- name 设置为
Access-Control-Allow-Origin
, value 为跨域网址 - name 设置为
Access-Control-Allow-Methods
,value 设置支持的 http methods,比如GET, POST, PUT, DELETE, OPTIONS
- name 设置为
Access-Control-Allow-Credentials
, value 设置为true
- name 设置为