Im using a dev enviroment with vagrant, running nginx, fpm and php 8.
The site runs fine with http1.1 but when I try to enable http2 in my nginx config I get this error in chrome.
And when I load the same page on firefox It loads fine with a 200 with HTTP2
This is my nginx config for the dev site.
server {
listen 127.0.0.1:9080;
server_name localhost DOMAIN;
root /var/www/techship/public;
access_log /var/www/techship/log/access.log;
client_max_body_size 1G;
expires 0;
location ~ \..*/.*\.php$ {
return 403;
}
location ~* (.+)\.(\d+)\.(js|css|png|jpg|jpeg|gif|ico)$ {
expires 0;
try_files $uri $1.$3;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors on;
fastcgi_pass unix:/run/php/php8.0-fpm.sock;
}
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name DOMAIN;
ssl_certificate certificates/dev.techship.crt;
ssl_certificate_key certificates/dev.techship.key;
ssl_session_timeout 1h;
ssl_session_cache shared:SSL:16m;
ssl_protocols TLSv1.3;
ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
ssl_prefer_server_ciphers on;
client_max_body_size 1G;
expires 0;
location / {
proxy_redirect off;
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 X-Client-Verify SUCCESS;
proxy_set_header X-SSL-Subject $ssl_client_s_dn;
proxy_set_header X-SSL-Issuer $ssl_client_i_dn;
proxy_set_header HTTPS on;
proxy_pass http://127.0.0.1:9080;
}
}
Removing the http2 directive and everything works again.
Any ideas why chrome gets this error, while firefox is working?
EDIT:
A incorrectly set header of "Last Modified" (should be "Last-Modified") was set by my PHP backend. I guess Chrome is being strict about incorrect headers and firefox is not.