File tree Expand file tree Collapse file tree 1 file changed +56
-0
lines changed Expand file tree Collapse file tree 1 file changed +56
-0
lines changed Original file line number Diff line number Diff line change @@ -489,6 +489,62 @@ http {
489
489
```
490
490
491
491
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
+
492
548
493
549
### HTTP 服务,绑定多个域名
494
550
You can’t perform that action at this time.
0 commit comments