Skip to content

Instantly share code, notes, and snippets.

@Nurlan199206
Last active December 22, 2023 16:30
Show Gist options
  • Save Nurlan199206/a1dd91e672ee8457e680d0d489df7149 to your computer and use it in GitHub Desktop.
Save Nurlan199206/a1dd91e672ee8457e680d0d489df7149 to your computer and use it in GitHub Desktop.
nginx-http3
example of HTTP3 on nginx
==============================================================
server {
listen 443 quic reuseport;
listen 443 ssl;
server_name test.mydomain.kz;
#access_log /var/log/nginx/host.access.log main;
ssl_certificate /etc/letsencrypt/live/test.mydomain.kz/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/test.mydomain.kz/privkey.pem;
ssl_protocols TLSv1.3;
ssl_early_data on;
location / {
add_header Alt-Svc 'h3=":443"; ma=86400';
root /usr/share/nginx/html;
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
==============================================================
proof
curl -I https://test.mydomain.kz --http3
HTTP/3 200
server: nginx/1.25.3
date: Fri, 22 Dec 2023 16:22:18 GMT
content-type: text/html
content-length: 5684
last-modified: Fri, 22 Dec 2023 16:16:43 GMT
etag: "6585b66b-1634"
alt-svc: h3=":443"; ma=86400
accept-ranges: bytes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment