소스 검색

feat: Add a warning comment if the container port is published

Richard Hansen 2 년 전
부모
커밋
daeed502cb
1개의 변경된 파일5개의 추가작업 그리고 0개의 파일을 삭제
  1. 5 0
      nginx.tmpl

+ 5 - 0
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 }}