nginx-proxy: ERR_HTTP2_SERVER_REFUSED_STREAM with PHP web application on 0.9.0
I’m running Xibo (which is PHP/Apache) behind nginx-proxy with the LetsEncrypt helper.
Normally no issues, but today I did a new install and on about 30% of my page loads (mainly javascript files), Chrome 90 gives an error loading those resources ERR_HTTP2_SERVER_REFUSED_STREAM
. Refreshing the page gets the error on a different number of those URLs. If I access the URLs individually they work as expected.
Dropping down to 0.8.0 fixes it, and going back to 0.9.0 causes it again, so I can only presume it’s something changing in nginx?
To replicate, you’d need a docker-compose setup like this:
version: "2.1"
services:
cms-db:
image: mysql:5.7
volumes:
- "./shared/db:/var/lib/mysql:Z"
environment:
- MYSQL_DATABASE=cms
- MYSQL_USER=cms
- MYSQL_RANDOM_ROOT_PASSWORD=yes
- MYSQL_PASSWORD=password123
cms-web:
image: xibosignage/xibo-cms:release-2.3.10
volumes:
- "./shared/cms/custom:/var/www/cms/custom:Z"
- "./shared/backup:/var/www/backup:Z"
- "./shared/cms/web/theme/custom:/var/www/cms/web/theme/custom:Z"
- "./shared/cms/library:/var/www/cms/library:Z"
- "./shared/cms/web/userscripts:/var/www/cms/web/userscripts:Z"
- "./shared/cms/ca-certs:/var/www/cms/ca-certs:Z"
links:
- cms-db:mysql
environment:
- XMR_HOST=cms-xmr
- VIRTUAL_HOST=cms.example.org
- LETSENCRYPT_HOST=cms.example.org
- LETSENCRYPT_EMAIL=user@example.org
- HTTPS_METHOD=noredirect
- SERVER_TOKENS=off
- MYSQL_PASSWORD=password123
cms-proxy:
image: jwilder/nginx-proxy:0.9.0
ports:
- 80:80
- 443:443
volumes:
- ./shared/proxy/certs:/etc/nginx/certs:ro
- /var/run/docker.sock:/tmp/docker.sock:ro
- /usr/share/nginx/html
labels:
- com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy
environment:
- "DEFAULT_HOST=cms.example.org"
- "DHPARAM_GENERATION=false"
cms-letsencrypt:
image: jrcs/letsencrypt-nginx-proxy-companion
volumes_from:
- cms-proxy
volumes:
- ./shared/proxy/certs:/etc/nginx/certs:rw
- /var/run/docker.sock:/var/run/docker.sock:ro
Once the containers are started, log in at https://cms.example.org
- username xibo_admin
, password password
and check the Chrome network access tab in developer tools.
About this issue
- Original URL
- State: open
- Created 3 years ago
- Comments: 26 (12 by maintainers)
I solved my
ERR_HTTP2_SERVER_REFUSED_STREAM
by setting a higher value forkeep-alive-requests
in my ingress-nginx:The default value for
keep-alive-requests
is1000
.http://nginx.org/en/docs/http/ngx_http_core_module.html#keepalive_requests
If you want to specify “unlimited” there is no such value; just set a high value. The higher the value the more memory your server will consume.
More info here: https://serverfault.com/a/425130/241371 and here: https://trac.nginx.org/nginx/ticket/2155
Relevant bits:
In
1.19.8
In
1.19.9
And maybe this in
1.19.10