-
Notifications
You must be signed in to change notification settings - Fork 0
nginx
Dr. Thomas Jansen edited this page Aug 9, 2023
·
3 revisions
If you are using the nginx HTTP server, add the following location
directive to your
nginx.conf
file:
location ~ /\.git {
deny all;
}
If you want to return a 404
HTTP status code instead of 403
, use the following instead:
location ~ /\.git {
return 404;
}
Don't forget to restart nginx after making the change, e.g. on Debian:
sudo systemctl restart nginx