Fix git directory access closes #251
This commit is contained in:
@@ -26,6 +26,12 @@ server {
|
|||||||
#real_ip_header X-Forwarded-For;
|
#real_ip_header X-Forwarded-For;
|
||||||
#set_real_ip_from 172.16.0.0/12;
|
#set_real_ip_from 172.16.0.0/12;
|
||||||
|
|
||||||
|
# block access to sensitive information about git
|
||||||
|
location /.git {
|
||||||
|
deny all;
|
||||||
|
return 403;
|
||||||
|
}
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
# First attempt to serve request as file, then
|
# First attempt to serve request as file, then
|
||||||
# as directory, then fall back to index.html
|
# as directory, then fall back to index.html
|
||||||
|
|||||||
@@ -19,6 +19,12 @@ server {
|
|||||||
#real_ip_header X-Forwarded-For;
|
#real_ip_header X-Forwarded-For;
|
||||||
#set_real_ip_from 172.16.0.0/12;
|
#set_real_ip_from 172.16.0.0/12;
|
||||||
|
|
||||||
|
# block access to sensitive information about git
|
||||||
|
location /.git {
|
||||||
|
deny all;
|
||||||
|
return 403;
|
||||||
|
}
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
# First attempt to serve request as file, then
|
# First attempt to serve request as file, then
|
||||||
# as directory, then fall back to index.html
|
# as directory, then fall back to index.html
|
||||||
|
|||||||
Reference in New Issue
Block a user