Access-Control-Allow-Origin

rusli
Site Admin
文章: 212
註冊時間: 週三 7月 07, 2010 9:49 pm

Access-Control-Allow-Origin

文章rusli » 週四 6月 20, 2019 10:14 am

代碼: 選擇全部


location /vmrecord {
        if ($request_method = OPTIONS ) {
                add_header Access-Control-Allow-Origin $http_origin;
                add_header Access-Control-Allow-Methods "OPTIONS";
                add_header Access-Control-Allow-Credentials "true";
                add_header 'Access-Control-Allow-Headers' '*,content-type,X-Access-Tk';
                #add_header Content-Length 0;
                #add_header Content-Type text/plain;
                return 200;
        }
        proxy_pass http://code_vedio;
        add_header 'Access-Control-Allow-Origin' $http_origin;
        add_header 'Access-Control-Allow-Credentials' 'true';
        add_header 'Access-Control-Allow-Methods' 'POST, GET, OPTIONS,PUT,DELETE';
        add_header 'Access-Control-Allow-Headers' '*,X-Access-Tk,x-requested-with,content-type';
        proxy_set_header Host $http_host;
        proxy_set_header Cookie $http_cookie;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        client_max_body_size  100m;
}


回到「Nginx」

誰在線上

正在瀏覽這個版面的使用者:沒有註冊會員 和 1 位訪客