- Notifications
You must be signed in to change notification settings - Fork65
Stable and up-to-date root-less nginx with quic + http/3, brotli and Zstandard compression, njs, GeoIP2, and Grade A+ SSL config
macbre/docker-nginx-http3
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Stable and up-to-datenginx withQUIC + HTTP/3 support,Google'sbrotli compression,zstd compression,njs module,kTLS/sendfile support andGrade A+ SSL config
As this project is based on the officialnginx image look for instructions there. In addition to the standard configuration directives, you'll be able to use the brotli module specific ones, seehere for official documentation
docker pull macbre/nginx-http3:latestYou can fetch an image fromGithub Containers Registry as well:
docker pull ghcr.io/macbre/nginx-http3:latest- built-in nginx modules
headers-more-nginx-module- sets and clears HTTP request and response headersngx_brotli- addsbrotli response compressionzstd-nginx-module- addsZstandard response compressionngx_http_geoip2_module- creates variables with values from the maxmind geoip2 databases based on the client IPnjsmodule - a subset of the JavaScript language that allows extending nginx functionality (GitHub repository)
$ docker run -it macbre/nginx-http3 nginx -Vnginx version: nginx/1.29.3 (279676b97237)built by gcc 13.2.1 20240309 (Alpine 13.2.1_git20240309) built with OpenSSL 3.3.5 30 Sep 2025TLS SNI support enabledconfigure arguments: --build=279676b97237 --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx/nginx.pid --lock-path=/var/run/nginx/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --with-http_auth_request_module --with-http_xslt_module=dynamic --with-http_image_filter_module=dynamic --with-http_geoip_module=dynamic --with-http_perl_module=dynamic --with-threads --with-stream --with-stream_ssl_module --with-stream_ssl_preread_module --with-stream_realip_module --with-stream_geoip_module=dynamic --with-http_slice_module --with-mail --with-mail_ssl_module --with-compat --with-file-aio --with-http_v2_module --with-http_v3_module --with-openssl-opt=enable-ktls --add-module=/usr/src/ngx_brotli --add-module=/usr/src/headers-more-nginx-module-0.38 --add-module=/usr/src/njs/nginx --add-module=/usr/src/zstd --add-dynamic-module=/usr/src/ngx_http_geoip2_module --with-cc-opt='-g -O2 -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -I /usr/src/quickjs' --with-ld-opt='-Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -flto=auto -L /usr/src/quickjs'$ docker run -it macbre/nginx-http3 njs -v0.9.3Please refer toMozilla's SSL Configuration Generator. This image hashttps://ssl-config.mozilla.org/ffdhe2048.txt DH parameters for DHE ciphers fetched and stored in/etc/ssl/dhparam.pem:
ssl_dhparam /etc/ssl/dhparam.pem;Seessllabs.com test results for wbc.macbre.net.
.conffiles mounted in/etc/nginx/main.dwill be included in themainnginx context (e.g. you can callenvdirective there).conffiles mounted in/etc/nginx/conf.dwill be included in thehttpnginx context
Please refer totests/https.conf config file for an example config used by the tests. And to Cloudflare docs onhow to enable http/3 support in your browser.
server { # http/3 listen 443 quic reuseport; # http/2 and http/1.1 listen 443 ssl; http2 on; server_name localhost; # customize to match your domain # you need to mount these files when running this container ssl_certificate /etc/nginx/ssl/localhost.crt; ssl_certificate_key /etc/nginx/ssl/localhost.key; # TLSv1.3 is required for QUIC. ssl_protocols TLSv1.2 TLSv1.3; # 0-RTT QUIC connection resumption ssl_early_data on; # Add Alt-Svc header to negotiate HTTP/3. add_header alt-svc 'h3=":443"; ma=86400'; # Sent when QUIC was used add_header QUIC-Status $http3; location / { # your config }}Refer torun-docker.sh script on how to run this container and properly mount required config files and assets.
Building an image:
docker pull ghcr.io/macbre/nginx-http3:latestDOCKER_BUILDKIT=1 docker build . -t macbre/nginx --cache-from=ghcr.io/macbre/nginx-http3:latest --progress=plainIt is necessary to expose both UDP and TCP ports to be able to HTTP/3
nginx:image:macbre/nginx-http3ports: -'443:443/tcp' -'443:443/udp'# use UDP for usage of HTTP/3
Note: both TCP and UDP HTTP/3 ports needs to be the same
About
Stable and up-to-date root-less nginx with quic + http/3, brotli and Zstandard compression, njs, GeoIP2, and Grade A+ SSL config
Topics
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Languages
- Dockerfile90.5%
- Shell6.9%
- JavaScript2.3%
- HTML0.3%
