I have Envoy Proxy handling SSL termination. Nginx (1.17.0 in a docker container, compiled --with-http_v2_module
) is one of several upstream services. As a result, Nginx receives traffic on port 443 but does not use the ssl
module:
server {
listen 443;
server_name example.com www.example.com;
root /var/www/html;
...
This works fine, but if I try to add http2
to the end of the listen line I receive:
curl: (1) Received HTTP/0.9 when not allowed
... not just for example.com in question, but all servers.
I would like Envoy to speak with Nginx via HTTP/2 for obvious performance reasons.
Is there some trick to make nginx use http2 on port 443 without SSL termination?
Edit:
The core nginx.conf
:
user nginx;
worker_processes 2;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
client_max_body_size 64M;
sendfile on;
keepalive_timeout 65;
fastcgi_cache_path /etc/nginx-cache levels=1:2 keys_zone=multipress:100m inactive=60m;
fastcgi_cache_key "$scheme$request_method$host$request_uri";
fastcgi_cache_use_stale error timeout invalid_header http_500;
fastcgi_ignore_headers Cache-Control Expires Set-Cookie;
gzip on;
include /etc/nginx/conf.d/*.conf;
}
Note that I can successfully curl the current Envoy HTTP2 server with an explicit curl --http2
command. The problem is the HTTP2 connection between Envoy and Nginx.