windows 环境下,nginx 配置跨域问题
server {
listen 8090;
server_name 192.168.1.* localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root E:/nginx-1.15.0/gcxt;
index index.html index.htm;
}
location ~/* {
#添加跨域配
add_header Access-Control-Allow-Origin $http_origin;
add_header Access-Control-Allow-Headers *;
add_header Access-Control-Allow-Methods *;
#Proxy Setting
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_max_temp_file_size 0;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_pass http://192.168.1.*:8714;
}
}
1.本站遵循行业规范,任何转载的稿件都会明确标注作者和来源;2.本站的原创文章,请转载时务必注明文章作者和来源,不尊重原创的行为我们将追究责任;3.作者投稿可能会经我们编辑修改或补充。