From ce0a9bac57408302fb7545010508642ac1758296 Mon Sep 17 00:00:00 2001 From: Giles Bradshaw Date: Tue, 5 May 2020 20:27:43 +0100 Subject: [PATCH] . --- letsencrypt-nginx/conf/git.conf | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/letsencrypt-nginx/conf/git.conf b/letsencrypt-nginx/conf/git.conf index aca0669..2085c1d 100644 --- a/letsencrypt-nginx/conf/git.conf +++ b/letsencrypt-nginx/conf/git.conf @@ -35,7 +35,7 @@ server { #access_log /var/log/nginx/access.log compression; server_name ${SERVER_NAME}; - location / { + location ~ /(.*) { sub_filter '' ' '; - - proxy_pass ${COMMENTO_PROXY_PASS}; + proxy_set_header Host ${DOLLAR}http_host; + proxy_set_header X-Real-IP ${DOLLAR}remote_addr; + proxy_set_header X-Forwarded-For ${DOLLAR}proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto ${DOLLAR}scheme; + proxy_buffering off; + set ${DOLLAR}upstream ${COMMENTO_PROXY_PASS}${DOLLAR}1${DOLLAR}is_args${DOLLAR}args; + proxy_pass ${DOLLAR}upstream; } } @@ -73,7 +78,7 @@ server { #access_log /var/log/nginx/access.log compression; server_name ${SERVER_NAME}; - location / { + location ~ /(.*) { sub_filter '' ' '; - - proxy_pass ${DRONE_PROXY_PASS}; + proxy_set_header Host ${DOLLAR}http_host; + proxy_set_header X-Real-IP ${DOLLAR}remote_addr; + proxy_set_header X-Forwarded-For ${DOLLAR}proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto ${DOLLAR}scheme; + proxy_buffering off; + + set ${DOLLAR}upstream ${DRONE_PROXY_PASS}${DOLLAR}1${DOLLAR}is_args${DOLLAR}args; + proxy_pass ${DOLLAR}upstream; } } server { @@ -115,7 +126,7 @@ server { # required to avoid HTTP 411: see Issue #1486 (https://github.com/moby/moby/issues/1486) chunked_transfer_encoding on; server_name ${SERVER_NAME}; - location /v2/(.*) { + locatio ~ /v2/(.*) { # Do not allow connections from docker 1.5 and earlier # docker pre-1.6.0 did not properly set the user agent on ping, catch "Go *" user agents if (${DOLLAR}http_user_agent ~ "^(docker\/1\.(3|4|5(?!\.[0-9]-dev))|Go ).*$" ) { @@ -175,7 +186,11 @@ server { '; - + proxy_set_header Host ${DOLLAR}http_host; + proxy_set_header X-Real-IP ${DOLLAR}remote_addr; + proxy_set_header X-Forwarded-For ${DOLLAR}proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto ${DOLLAR}scheme; + proxy_buffering off; set ${DOLLAR}upstream ${GIT_PROXY_PASS}${DOLLAR}1${DOLLAR}is_args${DOLLAR}args; proxy_pass ${DOLLAR}upstream; }