From 92b4e2773a17e255adbb5c76711200904b5ce7e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20Ka=CC=88ser?= Date: Wed, 12 Aug 2015 00:13:00 +0200 Subject: [PATCH 1/2] add additional reverse proxy headers that might improve compability for containerized apps --- lib/confs/nginx/ipynbsrv.conf | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/confs/nginx/ipynbsrv.conf b/lib/confs/nginx/ipynbsrv.conf index 1379430..3dc84d6 100644 --- a/lib/confs/nginx/ipynbsrv.conf +++ b/lib/confs/nginx/ipynbsrv.conf @@ -69,8 +69,8 @@ server { # use the Django error pages # forbidden = 404 so the user doesn't know there is a container # 50x grouped to 500 - error_page 403 404 /error/404; - error_page 500 502 503 504 /error/500; + error_page 403 404 /error/404; + error_page 500 502 503 504 /error/500; # needed for websockets connections proxy_http_version 1.1; @@ -79,10 +79,12 @@ server { proxy_read_timeout 86400s; proxy_send_timeout 86400s; - proxy_set_header Host $host; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Protocol $scheme; - proxy_set_header X-Real-IP $remote_addr; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Protocol $scheme; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Scheme $scheme; + proxy_set_header X-Script-Name /$1/; proxy_pass http://$decoded_backend; } From d9eecc056809183ecdaa663518046163e9b6e22c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20Ka=CC=88ser?= Date: Wed, 12 Aug 2015 00:53:00 +0200 Subject: [PATCH 2/2] additional Nginx proxy header fixes --- lib/confs/nginx/ipynbsrv.conf | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/confs/nginx/ipynbsrv.conf b/lib/confs/nginx/ipynbsrv.conf index 3dc84d6..c2bca92 100644 --- a/lib/confs/nginx/ipynbsrv.conf +++ b/lib/confs/nginx/ipynbsrv.conf @@ -80,11 +80,13 @@ server { proxy_send_timeout 86400s; proxy_set_header Host $host; + proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Protocol $scheme; + proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Scheme $scheme; - proxy_set_header X-Script-Name /$1/; + proxy_set_header X-Script-Name /ct/$1; proxy_pass http://$decoded_backend; }