From daeed502cb639e0ffdeca25522af1538e125ccb5 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Thu, 26 Jan 2023 18:53:50 -0500 Subject: [PATCH] feat: Add a warning comment if the container port is published --- nginx.tmpl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nginx.tmpl b/nginx.tmpl index 9251948..f236000 100644 --- a/nginx.tmpl +++ b/nginx.tmpl @@ -117,6 +117,11 @@ upstream {{ .Upstream }} { # Exposed ports:{{ range $container.Addresses }} {{ .Port }}/{{ .Proto }}{{ else }} (none){{ end }} # Default virtual port: {{ $defaultPort }} # VIRTUAL_PORT: {{ $container.Env.VIRTUAL_PORT }} + {{- if and $address $address.HostPort }} + # /!\ WARNING: Virtual port published on host. Clients might be able to + # bypass nginx-proxy and access the container's server + # directly. + {{- end }} {{- if $container.Node.ID }} # Swarm node name: {{ $container.Node.Name }} {{- end }}