From 0c439c32f90e6ed7b31af15736870e02cf2935b5 Mon Sep 17 00:00:00 2001 From: Ric Harvey Date: Wed, 6 Mar 2019 11:55:24 +0000 Subject: [PATCH] Fix git directory access closes #251 --- conf/nginx-site-ssl.conf | 6 ++++++ conf/nginx-site.conf | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/conf/nginx-site-ssl.conf b/conf/nginx-site-ssl.conf index 1bdf6e8..b022445 100644 --- a/conf/nginx-site-ssl.conf +++ b/conf/nginx-site-ssl.conf @@ -26,6 +26,12 @@ server { #real_ip_header X-Forwarded-For; #set_real_ip_from 172.16.0.0/12; + # block access to sensitive information about git + location /.git { + deny all; + return 403; + } + location / { # First attempt to serve request as file, then # as directory, then fall back to index.html diff --git a/conf/nginx-site.conf b/conf/nginx-site.conf index 4d9c6a6..3c38946 100644 --- a/conf/nginx-site.conf +++ b/conf/nginx-site.conf @@ -19,6 +19,12 @@ server { #real_ip_header X-Forwarded-For; #set_real_ip_from 172.16.0.0/12; + # block access to sensitive information about git + location /.git { + deny all; + return 403; + } + location / { # First attempt to serve request as file, then # as directory, then fall back to index.html