CLI
Serve Static Content
nginx进程需要有目标文件的访问权限 Http Load Balance
TCP Load Balance
Limit Bandwidth
下载大小超过10m后, 下载速率限制为1m/s Access Based on IP Address
allow 和 deny必须同时指定 HTTPS Redirects
重定向a.com的所有http请求到https |
HTTP Basic Authentication
- 使用openssl passwd 生成密码,并保存到指定文件 - 文件内容如:name:${加密后的密码}:注释内容 - auth_basic_user_file ${file_path} Health Check
被动式Health Check, 响应fails with an error达到3次时, 上游server将会被标记为不可用 TCP Health Check
主动式Health Check, 每10秒发送一次check, 成功2次才被视为Health Use Includes for Clean Configs
配置文件更为清晰,易于维护 |
Cheatography
https://cheatography.com
Nginx Config Cheat Sheet (DRAFT) by hulj
nginx常用配置
This is a draft cheat sheet. It is a work in progress and is not finished yet.