zfxcms ^回到顶部

您的当前位置:首页 > php资讯 > PHP基础 > nginx跨域问题

nginx跨域问题

所属分类: PHP基础   2021-12-15 14:55:53  编辑:admin  浏览次数 620 次

server

{

    listen 80;

    server_name 192.168.214.133;

    add_header Access-Control-Allow-Origin *;

    add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS';

    add_header Access-Control-Allow-Headers 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization';

    if ($request_method = 'OPTIONS') {

        return 204;

    }

    index index.php index.html index.htm default.php default.htm default.html;

    root /www/wwwroot/sss;

    

    #SSL-START SSL相关配置,请勿删除或修改下一行带注释的404规则

    #error_page 404/404.html;

    #SSL-END

    


PHP文章检索

PHP文章目录