avatar

sunday

Sunday's Blog

  • 首页
Home nginx1.25.0以上快速开启http3
文章

nginx1.25.0以上快速开启http3

Posted 2024-04-1 Updated 2024-04- 4
By sunday
2~2 min read

nginx 快速开启http3

参考以下配置:

server {
    listen 443 ssl;
    listen 443 quic reuseport; #开启http3特性 注意 reuseport 只能填写一次,比如你在另外个域名也是这样填写,会报duplicate的信息,nginx会自动复用端口
    http2 on;
    add_header alt-svc 'h3=":443"; ma=2592000'; #添加响应头
}

nginx的版本要1.25.0 及以上,才会包含http3的模块,不然就要自己源码编译了,最后记得开启443 UDP端口才能在chrome浏览器的console中看到h3协议,也可以到这个网站https://http3check.net/输入你的网站查看是否支持http3

nginx, 软件使用
nginx 软件使用
License:  CC BY 4.0
Share

Further Reading

Oct 30, 2024

nginx设置多个允许跨域的请求源

# 定义允许的源列表 map $http_origin $cors_origin { "https://youdomian.com" "https://youdomian.com"; "http://localhost:3010" "http://localhost:3010"; }

Apr 2, 2024

已安装的nginx,动态模块开启google brotli 压缩,并在vite项目中启用

1.下载ngx_brotli 到github https://github.com/google/ngx_brotli 然后git clone cd /usr/local/ git clone https://github.com/google/ngx_brotli.git cd /usr/loca

Apr 1, 2024

nginx1.25.0以上快速开启http3

nginx 快速开启http3 参考以下配置: server { listen 443 ssl; listen 443 quic reuseport; #开启http3特性 注意 reuseport 只能填写一次,比如你在另外个域名也是这样填写,会报duplicate的信息,ngin

OLDER

prisma使用两个数据库

NEWER

已安装的nginx,动态模块开启google brotli 压缩,并在vite项目中启用

Recently Updated

  • nextjs15使用better-sqlite3的连接报错问题
  • nextjs + clerk + supabase + realtime 实时监听数据库更改
  • 解决nextjs15使用useLocalStorage报错的问题
  • mac上使用nodejs appium控制chrome浏览器
  • 2024年终总结

Trending Tags

nginx acme 强制跳转HTTPS nodejs 代理 mac 神器 vue3 工具 docker

Contents

©2025 sunday. Some rights reserved.

Using the Halo theme Chirpy