国产+高潮+在线,国产 av 仑乱内谢,www国产亚洲精品久久,51国产偷自视频区视频,成人午夜精品网站在线观看

webman最新版資源文件放在pubic下面別的網(wǎng)站請求訪問下載會跨域

晚安。

問題描述

請問下這個問題要怎么處理下

Access to XMLHttpRequest at 'https://api.aaa.com/down_zip/20240525121035561765516.zip' from origin 'https://www.pppp.com' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

反向代理配置

#PROXY-START/

location ^~ /
{
    proxy_pass http://127.0.0.1:1300;
    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_set_header REMOTE-HOST $remote_addr;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection $connection_upgrade;
    proxy_http_version 1.1;
    # proxy_hide_header Upgrade;

    add_header Access-Control-Allow-Origin "*";
    add_header Access-Control-Allow-Methods "*";
    add_header Access-Control-Allow-Headers "authorization, token";
    add_header X-Cache $upstream_cache_status;
    #Set Nginx Cache

    set $static_filevO5uJYW3 0;
    if ( $uri ~* "\.(gif|png|jpg|css|js|woff|woff2)$" )
    {
        set $static_filevO5uJYW3 1;
        expires 1m;
    }
    if ( $static_filevO5uJYW3 = 0 )
    {
        add_header Cache-Control no-cache;
    }
}
#PROXY-END/
689 1 0
1個回答

latin

靜態(tài)資源一般都走的nginx,是否跨域與webman已經(jīng)沒有關(guān)系了,需要nginx里配置跨域頭,并重啟nginx。
如果還是提示 No 'Access-Control-Allow-Origin' header is present 那就是nginx哪里沒設(shè)置對或沖突了

  • 晚安。 2024-05-25

    nginx已經(jīng)配置了 上面發(fā)了

  • latin 2024-05-25

    就像我上面說的nginx哪里沒設(shè)置對或沖突了,比如走了其它地方設(shè)置了規(guī)則,沒走 location ^~ /

  • 晚安。 2024-05-25

    能幫我看下嗎 需要我發(fā)哪里的配置

  • 晚安。 2024-05-25

    zip后綴的就會提示跨域,png,jpg的就不會提示

  • laozhong 2024-12-08

    NGINX:

        add_header 'Access-Control-Allow-Credentials' 'true';
        add_header 'Access-Control-Allow-Origin' '*';
        add_header 'Access-Control-Allow-Methods' '*';
        add_header 'Access-Control-Allow-Headers' '*';

    app\middleware\AccessControl::process:

        // 如果是options請求則返回一個空響應(yīng),否則繼續(xù)向洋蔥芯穿越,并得到一個響應(yīng)
       $response = $request->method() == 'OPTIONS' ? response('') : $handler($request);
        // 給響應(yīng)添加跨域相關(guān)的http頭
        // $response->withHeaders([
        //     'Access-Control-Allow-Credentials' => 'true',
        //     'Access-Control-Allow-Origin' => $request->header('origin', '*'),
        //     'Access-Control-Allow-Methods' => $request->header('access-control-request-method', '*'),
        //     'Access-Control-Allow-Headers' => $request->header('access-control-request-headers', '*'),
        // ]);
    
        return $response;
年代過于久遠,無法發(fā)表回答
??