I am configuring nginx as a reverse proxy (in front of some http/1.1 servers). I initially set up an origin server on the nginx instance. As expected it returned content exclusively over HTTP/2. However when I configured nginx to provide a proxy service, it returned a mixture of HTTP2 and HTTP/1.1 responses.
server {
listen 443 ssl http2;
server_name www.example.com;
ssl_certificate /etc/nginx/ssl/example.com/cert.crt;
ssl_certificate_key /etc/nginx/ssl/example.com/cert.key;
include snippets/ssldefaults.conf;
location / {
proxy_http_version 1.1;
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_ssl_verify off;
proxy_pass https://192.168.23.12/
}
}
(I am using Chrome 76.0.3809.132 and nginx 1.14 to test this)
The different protocols seen coming from nginx are being sourced from the same origin server. My test case (for example) includes multiple cacheable CSS files - some arrive via HTTP2, some via 1.1.
What could be causing the difference?