nginx跨域设置

来源:互联网 发布:最新云豹直播系统源码 编辑:程序博客网 时间:2024/06/17 21:25
server {            listen   80;            server_name scxm;            location / {                    add_header 'Access-Control-Allow-Origin' '*';                #                # Om nom nom cookies                #                add_header 'Access-Control-Allow-Credentials' 'true';                add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';                #                 # Custom headers and headers various browsers *should* be OK with but aren't                #                add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';                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_pass http://127.0.0.1:8088;            }    }
原创粉丝点击