1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
server {
listen 80;
server_name example.com;
error_page 404 /404.html;
error_page 500 502 504 /50x.html;
error_page 503 =302 @huobao ; # 针对所有的 503 状态码,返回 302 并执行 @huobao 的操作
location @huobao {
# 如果项目本来支持 example.com/huobao.html ,则无需单独配置 location
rewrite ^(.*)$ /huobao.html redirect;
}
location = /huobao.html {
# 由于项目没有 huobao.html,需配置 location 转发至 nginx 的 html 目录下
root html;
}
location ~* / {
limit_req zone=one burst=5 nodelay;
root /usr/local/platform/webroot/example_com/;
}
}
|