From f49faf6119c73b25e3d932be95a26580661ec9f6 Mon Sep 17 00:00:00 2001 From: Brad Date: Sat, 18 Feb 2017 06:18:34 -0800 Subject: [PATCH] Update site.conf Add 2x location sections to enable portainer (container monitoring) to function --- data/conf/nginx/site.conf | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/data/conf/nginx/site.conf b/data/conf/nginx/site.conf index 467b56e4..b8b17cc1 100644 --- a/data/conf/nginx/site.conf +++ b/data/conf/nginx/site.conf @@ -1,4 +1,14 @@ proxy_cache_path /tmp levels=1:2 keys_zone=sogo:10m inactive=24h max_size=1g; + +upstream portainer { + server portainer-mailcow:9000; +} + +map $http_upgrade $connection_upgrade { + default upgrade; + '' close; +} + server { include /etc/nginx/conf.d/listen.active; include /etc/nginx/mime.types; @@ -132,5 +142,25 @@ server { proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504; #alias /usr/lib/GNUstep/SOGo/$1.SOGo/Resources/$2; } + + location /portainer/ { + proxy_http_version 1.1; + proxy_set_header Host $http_host; # required for docker client's sake + proxy_set_header X-Real-IP $remote_addr; # pass on real client's IP + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_read_timeout 900; + + proxy_set_header Connection ""; + proxy_buffers 32 4k; + proxy_pass http://portainer/; + } + + location /portainer/api/websocket/ { + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection $connection_upgrade; + proxy_pass http://portainer/api/websocket/; + } }