Quellcode durchsuchen

禁止访问任何 .conf 文件

xf vor 2 Tagen
Ursprung
Commit
9e2c17521b
1 geänderte Dateien mit 6 neuen und 0 gelöschten Zeilen
  1. 6 0
      nginx.conf

+ 6 - 0
nginx.conf

@@ -26,6 +26,12 @@ http {
         listen       80;
         server_name  localhost;
 
+        # 禁止访问任何 .conf 文件
+        location ~ \.conf$ {
+            deny all;
+            return 403;
+        }
+
         location /index.html {
             root       /usr/share/nginx/html;
             add_header Cache-Control "no-cache, no-store";