File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ server {
51
51
52
52
# …………
53
53
}
54
+
54
55
```
55
56
56
57
** 另外的写法:**
@@ -74,18 +75,35 @@ server {
74
75
75
76
# …………
76
77
}
78
+
79
+ ```
80
+
81
+ ** 其他配置:**
82
+
83
+ ``` conf
84
+ # 一般和伪静态规则在一起并放在伪静态规则之前
85
+ location / {
86
+ # 自动添加结尾斜杠
87
+ if (!-f $request_filename) {
88
+ rewrite ^/([^\.]+[^/])$ $scheme://$host/$1$2/ permanent;
89
+ }
90
+ # …………
91
+ }
92
+
77
93
```
78
94
79
95
然后重启 nginx
80
96
81
97
``` bash
82
98
/usr/local/nginx/sbin/nginx -s reload
99
+
83
100
```
84
101
85
102
下边命令为重启 lnmp
86
103
87
104
``` bash
88
105
/root/lnmp restart
106
+
89
107
```
90
108
91
109
相关推荐:
@@ -98,4 +116,6 @@ server {
98
116
99
117
[ 「备忘」Nginx 重定向(301)相关\_ 电脑网络\_ 沉冰浮水] ( https://www.wdssmq.com/post/20140819797.html " 「备忘」Nginx 重定向(301)相关\_ 电脑网络\_ 沉冰浮水 ") 「当前」
100
118
119
+ [ 「笔记」.htaccess 及 nginx.conf 可用变量一览\_ 电脑网络\_ 沉冰浮水] ( https://www.wdssmq.com/post/20220301043.html " 「笔记」.htaccess 及 nginx.conf 可用变量一览\_ 电脑网络\_ 沉冰浮水 ")
120
+
101
121
<!-- 2346-->
You can’t perform that action at this time.
0 commit comments