nginx location详细配置课件
location详细配置:1. location = # 精准匹配
2. location ^~ # 带参前缀匹配
3. location ~ # 正则匹配(区分大小写)
4. location ~* # 正则匹配(不区分大小写)
5. location /a # 普通前缀匹配,优先级低于带参数前缀匹配。
6. location / # 任何没有匹配成功的,都会匹配这里处理
server {
listen 80;
server_name www.it.com
location =/ {
return 404;
}
location / {
return 403;
}
location =/abc {
return 501;
}
location ^~ /pig {
return 502;
}
location ~* \.(gif|jpg|jpeg)$ {
return 500;
}
}
页:
[1]