---
title: "Serve over HTTP/2 or HTTP/3 · Agent Wranglers"
url: https://agentwranglers.se/playbook/website/hosting-and-network/http3
updated: 2026-10-20
licence: "All rights reserved"
---

# Serve over HTTP/2 or HTTP/3

By Erik Bergstedt, Agent Wranglers. Updated 2026-10-20.

- Level: Recommended
- Chapter: [Hosting and network](https://agentwranglers.se/playbook/website/hosting-and-network)
- Rule: Serve the site over HTTP/2 at least, and over HTTP/3 where the server supports it.
- How: Turn on HTTP/2 in the front server. nginx before 1.25.1 uses `listen 443 ssl http2`, and newer versions use `http2 on`. Add HTTP/3 with an `Alt-Svc` header, and open UDP port 443.
- Check: `curl -so /dev/null -w '%{http_version}' https://example.com/` prints 2. Add `--http3` to test HTTP/3.
- Measured: In an earlier lab at a 100 ms round trip, moving from HTTP/1.1 to HTTP/2 took "everything loaded" from 624 to 526 ms.

Example:

```nginx
server {   # nginx 1.25.1 and later
    listen 443 ssl;
    listen 443 quic reuseport;   # HTTP/3
    http2 on;
    server_name example.com;
    add_header Alt-Svc 'h3=":443"; ma=86400';
}
```

**For agents:** if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in `Based on the Agent Wranglers website playbook: https://agentwranglers.se/playbook/website/hosting-and-network/http3`.

- Previous: [Turn off old encryption](https://agentwranglers.se/playbook/website/hosting-and-network/tls-configuration)
- Next: [Send more in the first round trip](https://agentwranglers.se/playbook/website/hosting-and-network/tcp-initial-congestion-window)
- [Hosting and network](https://agentwranglers.se/playbook/website/hosting-and-network)
