example nginx configs updated to 404 all git folder access.
This commit is contained in:
@@ -17,6 +17,11 @@ server {
|
||||
|
||||
server_tokens off; # prevent nginx server detection
|
||||
|
||||
# restrict access to git folder
|
||||
location ~ /\.git {
|
||||
return 404;
|
||||
}
|
||||
|
||||
# optional, enforce primary domain
|
||||
#if ($host != $server_name) {
|
||||
# return 301 $scheme://$server_name$request_uri;
|
||||
|
||||
@@ -17,6 +17,11 @@ server {
|
||||
|
||||
server_tokens off; # prevent nginx server detection
|
||||
|
||||
# restrict access to git folder
|
||||
location ~ /\.git {
|
||||
return 404;
|
||||
}
|
||||
|
||||
# optional, enforce primary domain
|
||||
#if ($host != $server_name) {
|
||||
# return 301 $scheme://$server_name$request_uri;
|
||||
|
||||
Reference in New Issue
Block a user