Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # https://stackoverflow.com/questions/2999353/how-do-you-hide-git-project-directories
- # This location directive will deny access to any .git directory in any subdirectory.
- # Note: This location block must be before your main location block, so that it can be evaluated first.
- # my config file: /etc/nginx/conf.d/default.conf dont use ../nginx.conf it override your web location path !!!
- http {
- server {
- location ~ /\.git {
- deny all;
- }
- }
- }
- # To restart nginx
- /etc/init.d/nginx restart
- # OR
- service nginx restart
Add Comment
Please, Sign In to add comment