|
@@ -150,6 +150,10 @@ upstream {{ $upstream_name }} {
|
|
{{/* Get the HTTPS_METHOD defined by containers w/ the same vhost, falling back to "redirect" */}}
|
|
{{/* Get the HTTPS_METHOD defined by containers w/ the same vhost, falling back to "redirect" */}}
|
|
{{ $https_method := or (first (groupByKeys $containers "Env.HTTPS_METHOD")) "redirect" }}
|
|
{{ $https_method := or (first (groupByKeys $containers "Env.HTTPS_METHOD")) "redirect" }}
|
|
|
|
|
|
|
|
+{{/* Get the VIRTUAL_ROOT By containers w/ use fastcgi root */}}
|
|
|
|
+{{ $vhost_root := or (first (groupByKeys $containers "Env.VIRTUAL_ROOT")) "/var/www/public" }}
|
|
|
|
+
|
|
|
|
+
|
|
{{/* Get the first cert name defined by containers w/ the same vhost */}}
|
|
{{/* Get the first cert name defined by containers w/ the same vhost */}}
|
|
{{ $certName := (first (groupByKeys $containers "Env.CERT_NAME")) }}
|
|
{{ $certName := (first (groupByKeys $containers "Env.CERT_NAME")) }}
|
|
|
|
|
|
@@ -222,6 +226,10 @@ server {
|
|
{{ if eq $proto "uwsgi" }}
|
|
{{ if eq $proto "uwsgi" }}
|
|
include uwsgi_params;
|
|
include uwsgi_params;
|
|
uwsgi_pass {{ trim $proto }}://{{ trim $upstream_name }};
|
|
uwsgi_pass {{ trim $proto }}://{{ trim $upstream_name }};
|
|
|
|
+ {{ else if eq $proto "fastcgi" }}
|
|
|
|
+ root {{ trim $vhost_root }};
|
|
|
|
+ include fastcgi.conf;
|
|
|
|
+ fastcgi_pass {{ trim $upstream_name }};
|
|
{{ else }}
|
|
{{ else }}
|
|
proxy_pass {{ trim $proto }}://{{ trim $upstream_name }};
|
|
proxy_pass {{ trim $proto }}://{{ trim $upstream_name }};
|
|
{{ end }}
|
|
{{ end }}
|
|
@@ -260,6 +268,10 @@ server {
|
|
{{ if eq $proto "uwsgi" }}
|
|
{{ if eq $proto "uwsgi" }}
|
|
include uwsgi_params;
|
|
include uwsgi_params;
|
|
uwsgi_pass {{ trim $proto }}://{{ trim $upstream_name }};
|
|
uwsgi_pass {{ trim $proto }}://{{ trim $upstream_name }};
|
|
|
|
+ {{ else if eq $proto "fastcgi" }}
|
|
|
|
+ root {{ trim $vhost_root }};
|
|
|
|
+ include fastcgi.conf;
|
|
|
|
+ fastcgi_pass {{ trim $upstream_name }};
|
|
{{ else }}
|
|
{{ else }}
|
|
proxy_pass {{ trim $proto }}://{{ trim $upstream_name }};
|
|
proxy_pass {{ trim $proto }}://{{ trim $upstream_name }};
|
|
{{ end }}
|
|
{{ end }}
|
|
@@ -291,4 +303,4 @@ server {
|
|
{{ end }}
|
|
{{ end }}
|
|
|
|
|
|
{{ end }}
|
|
{{ end }}
|
|
-{{ end }}
|
|
|
|
|
|
+{{ end }}
|