diff --git a/nginx.tmpl b/nginx.tmpl index 2414633..2229331 100644 --- a/nginx.tmpl +++ b/nginx.tmpl @@ -242,6 +242,9 @@ upstream {{ $upstream_name }} { {{/* Get the VIRTUAL_ROOT By containers w/ use fastcgi root */}} {{ $vhost_root := or (first (groupByKeys $containers "Env.VIRTUAL_ROOT")) "/var/www/public" }} +{{/* Get the SERVER_PASS By containers e.g. proxy_pass..., grpc_pass..., fastcgi_pass... */}} +{{ $server_pass := or ($container.Env.SERVER_PASS) "" }} + {{/* Get the first cert name defined by containers w/ the same vhost */}} {{ $certName := (first (groupByKeys $containers "Env.CERT_NAME")) }} @@ -338,7 +341,9 @@ server { {{ end }} location / { - {{ if eq $proto "uwsgi" }} + {{ if ne $server_pass "" }} + {{ $server_pass }}; + {{ else if eq $proto "uwsgi" }} include uwsgi_params; uwsgi_pass {{ trim $proto }}://{{ trim $upstream_name }}; {{ else if eq $proto "fastcgi" }} @@ -390,7 +395,9 @@ server { {{ end }} location / { - {{ if eq $proto "uwsgi" }} + {{ if ne $server_pass "" }} + {{ $server_pass }}; + {{ else if eq $proto "uwsgi" }} include uwsgi_params; uwsgi_pass {{ trim $proto }}://{{ trim $upstream_name }}; {{ else if eq $proto "fastcgi" }} @@ -434,3 +441,4 @@ server { {{ end }} {{ end }} +