Skip to content

Commit f454d0a

Browse files
feat: more effectively blocking site scanners
1 parent eeb3a3e commit f454d0a

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

nginx/filesystem/etc/nginx/conf.d/nginx.conf

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,14 @@ server {
4343
#charset koi8-r;
4444
#access_log /var/log/nginx/host.access.log main;
4545

46+
location = / {
47+
root /usr/share/nginx/html;
48+
try_files /index.html =404;
49+
}
50+
4651
location / {
4752
root /usr/share/nginx/html;
48-
# First attempt to serve request as file, then
49-
# as directory, then redirect to index(angular) if no file found.
50-
try_files $uri $uri/ /index.html;
53+
try_files $uri $uri/ =404;
5154
}
5255

5356
location /api/v1 {
@@ -98,14 +101,9 @@ server {
98101

99102
error_page 404 /404.html;
100103

101-
location ~ 404 {
102-
root /usr/share/nginx/html;
103-
try_files /404.html =404;
104-
}
105-
106-
location ~ 404.html {
104+
location = /404.html {
107105
root /usr/share/nginx/html;
108-
try_files /404.html =404;
106+
internal;
109107
}
110108

111109
# redirect server error pages to the static page /50x.html

0 commit comments

Comments
 (0)