diff --git a/nginx/files/nginx/snippets/evolinux_server_custom b/nginx/files/nginx/snippets/evolinux_server_custom new file mode 100644 index 00000000..f7f34ef9 --- /dev/null +++ b/nginx/files/nginx/snippets/evolinux_server_custom @@ -0,0 +1,7 @@ +# Evolinux custom configuration, to be used in all server blocks + +location ~ /\.(inc|git|bak|env) { + # We don't want to let the client know a file exist on the server, + # so we return 404 "Not found" instead of 403 "Forbidden". + return 404; +} diff --git a/nginx/templates/evolinux-default.conf.j2 b/nginx/templates/evolinux-default.conf.j2 index 1a385e17..a0ed95c3 100644 --- a/nginx/templates/evolinux-default.conf.j2 +++ b/nginx/templates/evolinux-default.conf.j2 @@ -49,6 +49,8 @@ server { stub_status on; access_log off; } + + include /etc/nginx/snippets/evolinux_server_custom; } server {