From c22e25e3d2abb44e86774d23f13d6bc58b0fb712 Mon Sep 17 00:00:00 2001 From: slawkens Date: Mon, 6 Mar 2023 08:26:29 +0100 Subject: [PATCH] Update nginx-sample.conf --- nginx-sample.conf | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/nginx-sample.conf b/nginx-sample.conf index 8db44d54..2ae14251 100644 --- a/nginx-sample.conf +++ b/nginx-sample.conf @@ -7,6 +7,23 @@ server { # increase max file upload client_max_body_size 10M; + # this is very important, be sure its in your nginx conf - it prevents access to logs etc. + location ~ /system { + deny all; + return 404; + } + + # block .htaccess + location ~ /\.ht { + deny all; + } + + # block git files and folders + location ~ /\.git { + return 404; + deny all; + } + location / { try_files $uri $uri/ /index.php; } @@ -15,16 +32,6 @@ server { include snippets/fastcgi-php.conf; fastcgi_read_timeout 240; fastcgi_pass unix:/var/run/php/php7.4-fpm.sock; - # for ubuntu 22.04+ it will be php8.1-sock - } - - location ~ /\.ht { - deny all; - } - - # this is very important, be sure its in your nginx conf - it prevents access to logs etc. - location /system { - deny all; - return 404; + # for ubuntu 22.04+ it will be php8.1-fpm.-sock } }