macbre / docker-nginx-http3

Stable and up-to-date root-less nginx with quic + http/3, google brotli compression, njs, GeoIP2, and Grade A+ SSL config
https://hub.docker.com/r/macbre/nginx-http3
161 stars 53 forks source link

Browsers still using HTTP2 #78

Closed wibimaster closed 2 years ago

wibimaster commented 2 years ago

Hi !

I'm trying to build an HTTP3 server with your Docker image, but can't get it working :/

I'm starting it with the command :

docker run --rm   -p 0.0.0.0:8888:80   -p 0.0.0.0:443:443/tcp   -p 0.0.0.0:443:443/udp   \
  -v "$PWD/tests":/static:ro   \
  -v "$PWD/tests/modules.conf":/etc/nginx/main.d/modules.conf:ro   \
  -v "$PWD/tests/perl_rewrite.conf":/etc/nginx/conf.d/perl_rewrite.conf:ro   \
  -v "$PWD/tests/static.conf":/etc/nginx/conf.d/static.conf:ro   \
  -v "$PWD/tests/https.conf":/etc/nginx/conf.d/https.conf:ro   \
  -v "$PWD/tests/localhost.crt":/etc/nginx/ssl/localhost.crt:ro   \
  -v "$PWD/tests/localhost.key":/etc/nginx/ssl/localhost.key:ro  \
  --name test_nginx \
  -t macbre/nginx-http3:latest

Before that I rewrote the https.conf to send the Alt-Svc header with port 443 instead of 8443.

I just replaced the certificates by some I built with Certbot, to make them valid.

If I load my domain in Chrome or Firefox (http3 enabled), the It works page (index.html) loads, but in the Network tab I can see it use HTTP2 instead of 3.

If I test it on https://www.http3check.net/, it fails with "QUIC connection could not be established"

Do you have any clue, or a working live example ?

Thanks !

macbre commented 2 years ago

Did you try checking your server with curl?

        docker run --rm --network host ymuski/curl-http3 \ 
           curl -v https://localhost:8889 --http3 2>&1 | tee /tmp/h3

Of course replace the localhost with your domain :)

Run it both from your server directly and from your local machine.

macbre commented 2 years ago

Additionally, is UDP port 443 open at the firewall?

macbre commented 2 years ago

Should resolve https://github.com/macbre/phantomas/pull/970

macbre commented 2 years ago

Interestingly, Firefox 100.0 on MacOS works fine:

Screenshot 2022-06-13 at 13 49 39
macbre commented 2 years ago

Let's merge this one with #81.