add .git to denied folders in nginx

This commit is contained in:
slawkens 2023-02-28 19:05:34 +01:00
parent 2ac8ed7411
commit c03b041f40

View File

@ -3,7 +3,7 @@ server {
root /home/otserv/www/public; root /home/otserv/www/public;
index index.php; index index.php;
server_name your-domain.com; server_name your-domain.com;
location ~ /system { location ~ /system {
deny all; deny all;
return 404; return 404;
@ -13,6 +13,11 @@ server {
deny all; deny all;
} }
location ~ /\.git {
return 404;
deny all;
}
location / { location / {
try_files $uri $uri/ /index.php; try_files $uri $uri/ /index.php;
} }
@ -22,4 +27,4 @@ server {
fastcgi_read_timeout 240; fastcgi_read_timeout 240;
fastcgi_pass unix:/var/run/php/php7.3-fpm.sock; fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
} }
} }