小编Bag*_*lid的帖子

HTTP/2 服务器推送的资源无法加载 (HTTP2_CLIENT_REFUSED_STREAM)

ERR_HTTP2_CLIENT_REFUSED_STREAM对于通过 http2 推送的全部或部分资源,我在 chrome devtools 控制台中出现以下错误。

ERR_HTTP2_CLIENT_REFUSED_STREAM

刷新页面并随机清除缓存可以部分甚至完全解决此问题。

我正在使用启用了 http2 的 nginx(通过 certbot 进行 ssl)和 cloudflare。

server {
    server_name $HOST;
    root /var/www/$HOST/current/public;

    add_header X-Frame-Options "SAMEORIGIN";
    add_header X-XSS-Protection "1; mode=block";
    add_header X-Content-Type-Options "nosniff";

    index index.html index.htm index.php;

    charset utf-8;

    set $auth "dev-Server.";

    if ($request_uri ~ ^/opcache-api/.*$){
    set $auth off;
    }

    auth_basic $auth;
    auth_basic_user_file /etc/nginx/.htpasswd;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location = /favicon.ico { access_log off; log_not_found off; }
    location = /robots.txt  { access_log off; log_not_found off; }

    error_page …
Run Code Online (Sandbox Code Playgroud)

google-chrome nginx cloudflare laravel http2

5
推荐指数
1
解决办法
2667
查看次数

标签 统计

cloudflare ×1

google-chrome ×1

http2 ×1

laravel ×1

nginx ×1