From 3f1d3b9cecbf7775c1c06fee796d948dad116316 Mon Sep 17 00:00:00 2001 From: Gregory Colpart Date: Tue, 23 Apr 2024 09:56:48 +0200 Subject: [PATCH] ajout de snippets/evolinux_server_custom --- HowtoNginx.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/HowtoNginx.md b/HowtoNginx.md index 3fa20750..c117369e 100644 --- a/HowtoNginx.md +++ b/HowtoNginx.md @@ -118,6 +118,16 @@ server_name_in_redirect off; index index.html; ~~~ +Le fichier `nginx/snippets/evolinux_server_custom` contient notre configuration à inclure dans chaque bloc "server" : + +~~~ +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; +} +~~~ + Le fichier `/etc/nginx/snippets/ipaddr_whitelist` centralise les adresses IP privilégiées, on peut ainsi utiliser `include /etc/nginx/snippets/ipaddr_whitelist;` à différents endroits dans la configuration de Nginx sans dupliquer ces adresses : ~~~