ERR_HTTP2_CLIENT_REFUSED_STREAM对于通过 http2 推送的全部或部分资源,我在 chrome devtools 控制台中出现以下错误。
刷新页面并随机清除缓存可以部分甚至完全解决此问题。
我正在使用启用了 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)