Files

43 lines
1.6 KiB
Markdown

---
id: devops.nginx.index
title: Nginx
type: index
domain: devops
stack: [nginx]
tags: [Nginx, 反向代理, HTTPS, 负载均衡, SSE]
week: [3, 7, 14]
---
# Nginx
前端出身的你对 Nginx 应该不陌生(部署 SPA、配置代理)。转后端 / AI 应用后要再往前走一步:反向代理和负载均衡、HTTPS、**大模型流式输出(SSE)的代理配置**、限流、灰度发布,以及常见 502/504 问题的排查。
## 学习路线
| 顺序 | 课程 | 级别 | 预计 |
| --- | --- | --- | --- |
| 1 | [反向代理、负载均衡和静态资源:location 匹配、proxy_pass、SPA 回退](01-proxy-static.md) | 基础 | 2 小时 |
| 2 | [HTTPS、SSE / WebSocket、限流和灰度](02-https-stream-limit.md) | 进阶 | 3 小时 |
## 企业场景
- [AI 应用网关:流式输出不卡顿、按用户灰度新版本](scenarios/ai-gateway-sse-canary.md)
## 面试题
- [Nginx 面试题](interview.md)
## 示例代码
- [examples/gateway](examples/gateway/):网关配置模板 + pytest 测试,用真实 Nginx 验证反向代理、SPA 回退、SSE 不缓冲、限流、Cookie 灰度(本机没有 nginx 时测试自动跳过)
## 在 16 周计划中
- [第 3 周:项目一部署](../../../plan/week03-project1.md)、[第 7 周:前端部署](../../../plan/week07-frontend.md)、[第 14 周:部署](../../../plan/week14-backend-extend-deploy.md)
## 官方资料
- Nginx 文档:https://nginx.org/en/docs/
- 代理模块参数:https://nginx.org/en/docs/http/ngx_http_proxy_module.html
- 限流模块:https://nginx.org/en/docs/http/ngx_http_limit_req_module.html