Skip to content

Commit c5147f1

Browse files
author
zhangchaohuang@banggood.com
committed
2017-08-30 完善 nginx location 内容
1 parent 8c7e6ae commit c5147f1

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

Nginx-Install-And-Settings.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,62 @@ http {
489489
```
490490

491491

492+
## Nginx 配置文件常用配置积累
493+
494+
### location 配置
495+
496+
497+
``` nginx
498+
= 开头表示精确匹配
499+
^~ 开头表示uri以某个常规字符串开头,不是正则匹配
500+
~ 开头表示区分大小写的正则匹配;
501+
~* 开头表示不区分大小写的正则匹配
502+
/ 通用匹配, 如果没有其它匹配,任何请求都会匹配到
503+
504+
location / {
505+
506+
}
507+
508+
location /user {
509+
510+
}
511+
512+
location = /user {
513+
514+
}
515+
516+
location /user/ {
517+
518+
}
519+
520+
location ^~ /user/ {
521+
522+
}
523+
524+
location /user/youmeek {
525+
526+
}
527+
528+
location ~ /user/youmeek {
529+
530+
}
531+
532+
location ~ ^(/cas/|/casclient1/|/casclient2/|/casclient3/) {
533+
534+
}
535+
536+
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|ico|woff|woff2|ttf|eot|txt)$ {
537+
538+
}
539+
540+
location ~ .*$ {
541+
542+
}
543+
```
544+
545+
546+
547+
492548

493549
### HTTP 服务,绑定多个域名
494550

0 commit comments

Comments
 (0)