location ^~ / {
proxy_pass http://localhost:3336;
# 基础头部设置
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
# 连接相关头部
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
proxy_http_version 1.1;
# 缓存和安全头部
add_header X-Cache $upstream_cache_status;
add_header Strict-Transport-Security "max-age=31536000";
proxy_ssl_server_name off;
proxy_ssl_name $proxy_host;
# 如果支持h3
add_header Alt-Svc 'h3=":443"; ma=2592000';
}
wood
1
相关话题
| 话题 | 回复 | 浏览量 | 活动 | |
|---|---|---|---|---|
| Nginx反向代理根目录时,怎么让某个链接或页面不被代理? | 1 | 84 | 2024 年8 月 26 日 | |
| 请求项目API出现CORS跨域错误 | 0 | 9 | 2024 年8 月 26 日 | |
| Nginx反代cdnjs和fonts | 0 | 14 | 2024 年9 月 7 日 | |
| 雷池waf设置proxy_buffering off | 0 | 25 | 2024 年9 月 2 日 | |
| proxy-go 不同路径代理服务项目介绍,部署方法和更新日志 | 25 | 372 | 2025 年3 月 12 日 | |
| webp-server-go 重构二开版 支持非图片资源302重定向和直接返回和内存优化等 | 0 | 65 | 2024 年9 月 29 日 | |
| SPA / nextjs静态打包后部署到nginx, 伪静态规则 | 0 | 13 | 2025 年3 月 5 日 | |
| nginx-ui:用Web界面轻松管理Nginx | 0 | 26 | 2025 年7 月 30 日 | |
| 为什么放弃webp-server-go | 0 | 43 | 2024 年10 月 29 日 | |
| 1panel + docker-openresty + discourse + cloudflare 使用socket连接 显示真实用户IP | 0 | 26 | 2025 年6 月 20 日 |