Nginx配置跨域


nginx.conf

server内配置

1
2
3
4
5
6
7
8
#允许跨域请求的域,* 代表所有
add_header 'Access-Control-Allow-Origin' *;
#允许请求的header
add_header 'Access-Control-Allow-Headers' *;
#允许带上cookie请求
add_header 'Access-Control-Allow-Credentials' 'true';
#允许请求的方法,比如 GET,POST,PUT,DELETE
add_header 'Access-Control-Allow-Methods' *;

← Prev SpringBoot项目整合Swagger实现在线文档 | RabbitMQ五种模式的基本实现 Next →