server {
listen 22222;
server_name localhost;
location / {
add_header Access-Control-Allow-Origin '*' always;
add_header Access-Control-Allow-Headers '*';
add_header Access-Control-Allow-Methods '*';
add_header Access-Control-Allow-Credentials 'true';
if ($request_method = 'OPTIONS') {
return 204;
}
proxy_pass http://localhost:59200;
}
}
原文链接:https://blog.csdn.net/qq_44866828/article/details/124374747
nignx 添加请求头解决跨域
最新推荐文章于 2024-07-02 17:47:37 发布