From d8368ec939cd3bcfa2f55f2148547b32906b2035 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Pirez=20Nu=C3=B1ez?= Date: Mon, 17 Apr 2017 10:55:34 -0500 Subject: [PATCH 1/2] Access VTS when using proxy_protocol When I activate proxy_protocol in version 0.8.3 I can not see the vts-status page, add a server to create a proxy to the original, so I can activate the proxy_protocol and see the VTS statistics; Maybe it's not the best solution but it works. Do not add the proxy_protocol conditional on server 18080 because if enabled the / healthz path does not work for K8S. Thanks in advance --- controllers/nginx/rootfs/etc/nginx/template/nginx.tmpl | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/controllers/nginx/rootfs/etc/nginx/template/nginx.tmpl b/controllers/nginx/rootfs/etc/nginx/template/nginx.tmpl index 920a487e6..e6c0001b6 100644 --- a/controllers/nginx/rootfs/etc/nginx/template/nginx.tmpl +++ b/controllers/nginx/rootfs/etc/nginx/template/nginx.tmpl @@ -473,6 +473,16 @@ http { {{ end }} } } + + {{- if $cfg.enableVtsStatus }} + server { + listen 18081 {{ if $cfg.useProxyProtocol -}} proxy_protocol {{ end -}} reuseport; + + location /nginx_status { + proxy_pass http://127.0.0.1:18080; + } + } + {{ end -}} } stream { From a5ca4e6d71073cc9e4dc3609e4c53168df80e405 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Pirez=20Nu=C3=B1ez?= Date: Mon, 17 Apr 2017 15:46:02 -0500 Subject: [PATCH 2/2] Update nginx.tmpl --- controllers/nginx/rootfs/etc/nginx/template/nginx.tmpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/controllers/nginx/rootfs/etc/nginx/template/nginx.tmpl b/controllers/nginx/rootfs/etc/nginx/template/nginx.tmpl index e6c0001b6..db63ecdee 100644 --- a/controllers/nginx/rootfs/etc/nginx/template/nginx.tmpl +++ b/controllers/nginx/rootfs/etc/nginx/template/nginx.tmpl @@ -474,9 +474,9 @@ http { } } - {{- if $cfg.enableVtsStatus }} + {{- if $cfg.EnableVtsStatus }} server { - listen 18081 {{ if $cfg.useProxyProtocol -}} proxy_protocol {{ end -}} reuseport; + listen 18081 {{ if $cfg.UseProxyProtocol -}} proxy_protocol {{ end -}} reuseport; location /nginx_status { proxy_pass http://127.0.0.1:18080;