Fallback to empty string when VIRTUAL_PATH_STRIP not specified
This commit is contained in:
parent
416050f1c6
commit
9b38175c06
1 changed files with 8 additions and 8 deletions
16
nginx.tmpl
16
nginx.tmpl
|
@ -297,20 +297,20 @@ server {
|
||||||
{{ $is_regexp := hasPrefix "^" $location }}
|
{{ $is_regexp := hasPrefix "^" $location }}
|
||||||
{{ $modifier := when $is_regexp "~" "" }}
|
{{ $modifier := when $is_regexp "~" "" }}
|
||||||
|
|
||||||
{{ if (eq $container.Env.VIRTUAL_PATH_STRIP "true") }}
|
{{ if (eq (or ($container.Env.VIRTUAL_PATH_STRIP) "") "true") }}
|
||||||
location {{ $modifier }} '{{ $location }}' {
|
location {{ $modifier }} '{{ $location }}' {
|
||||||
return 302 '{{ $location }}/';
|
return 302 '{{ $location }}/';
|
||||||
}
|
}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ if (eq $container.Env.VIRTUAL_PATH_STRIP "true") }}
|
{{ if (eq (or ($container.Env.VIRTUAL_PATH_STRIP) "") "true") }}
|
||||||
location {{ $modifier }} '{{ $location }}/' {
|
location {{ $modifier }} '{{ $location }}/' {
|
||||||
{{ else }}
|
{{ else }}
|
||||||
location {{ $modifier }} '{{ $location }}' {
|
location {{ $modifier }} '{{ $location }}' {
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ if eq $proto "uwsgi" }}
|
{{ if eq $proto "uwsgi" }}
|
||||||
include uwsgi_params;
|
include uwsgi_params;
|
||||||
{{ if (eq $container.Env.VIRTUAL_PATH_STRIP "true") }}
|
{{ if (eq (or ($container.Env.VIRTUAL_PATH_STRIP) "") "true") }}
|
||||||
uwsgi_pass {{ trim $proto }}://{{ trim $container.Name }}/;
|
uwsgi_pass {{ trim $proto }}://{{ trim $container.Name }}/;
|
||||||
{{ else }}
|
{{ else }}
|
||||||
uwsgi_pass {{ trim $proto }}://{{ trim $container.Name }};
|
uwsgi_pass {{ trim $proto }}://{{ trim $container.Name }};
|
||||||
|
@ -320,7 +320,7 @@ server {
|
||||||
include fastcgi_params;
|
include fastcgi_params;
|
||||||
fastcgi_pass {{ trim $container.Name }};
|
fastcgi_pass {{ trim $container.Name }};
|
||||||
{{ else }}
|
{{ else }}
|
||||||
{{ if (eq $container.Env.VIRTUAL_PATH_STRIP "true") }}
|
{{ if (eq (or ($container.Env.VIRTUAL_PATH_STRIP) "") "true") }}
|
||||||
proxy_pass {{ trim $proto }}://{{ trim $container.Name }}/;
|
proxy_pass {{ trim $proto }}://{{ trim $container.Name }}/;
|
||||||
{{ else }}
|
{{ else }}
|
||||||
proxy_pass {{ trim $proto }}://{{ trim $container.Name }};
|
proxy_pass {{ trim $proto }}://{{ trim $container.Name }};
|
||||||
|
@ -370,20 +370,20 @@ server {
|
||||||
{{ $is_regexp := hasPrefix "^" $location }}
|
{{ $is_regexp := hasPrefix "^" $location }}
|
||||||
{{ $modifier := when $is_regexp "~" "" }}
|
{{ $modifier := when $is_regexp "~" "" }}
|
||||||
|
|
||||||
{{ if (eq $container.Env.VIRTUAL_PATH_STRIP "true") }}
|
{{ if (eq (or ($container.Env.VIRTUAL_PATH_STRIP) "") "true") }}
|
||||||
location {{ $modifier }} '{{ $location }}' {
|
location {{ $modifier }} '{{ $location }}' {
|
||||||
return 302 '{{ $location }}/';
|
return 302 '{{ $location }}/';
|
||||||
}
|
}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ if (eq $container.Env.VIRTUAL_PATH_STRIP "true") }}
|
{{ if (eq (or ($container.Env.VIRTUAL_PATH_STRIP) "") "true") }}
|
||||||
location {{ $modifier }} '{{ $location }}/' {
|
location {{ $modifier }} '{{ $location }}/' {
|
||||||
{{ else }}
|
{{ else }}
|
||||||
location {{ $modifier }} '{{ $location }}' {
|
location {{ $modifier }} '{{ $location }}' {
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ if eq $proto "uwsgi" }}
|
{{ if eq $proto "uwsgi" }}
|
||||||
include uwsgi_params;
|
include uwsgi_params;
|
||||||
{{ if (eq $container.Env.VIRTUAL_PATH_STRIP "true") }}
|
{{ if (eq (or ($container.Env.VIRTUAL_PATH_STRIP) "") "true") }}
|
||||||
uwsgi_pass {{ trim $proto }}://{{ trim $container.Name }}/;
|
uwsgi_pass {{ trim $proto }}://{{ trim $container.Name }}/;
|
||||||
{{ else }}
|
{{ else }}
|
||||||
uwsgi_pass {{ trim $proto }}://{{ trim $container.Name }};
|
uwsgi_pass {{ trim $proto }}://{{ trim $container.Name }};
|
||||||
|
@ -393,7 +393,7 @@ server {
|
||||||
include fastcgi_params;
|
include fastcgi_params;
|
||||||
fastcgi_pass {{ trim $container.Name }};
|
fastcgi_pass {{ trim $container.Name }};
|
||||||
{{ else }}
|
{{ else }}
|
||||||
{{ if (eq $container.Env.VIRTUAL_PATH_STRIP "true") }}
|
{{ if (eq (or ($container.Env.VIRTUAL_PATH_STRIP) "") "true") }}
|
||||||
proxy_pass {{ trim $proto }}://{{ trim $container.Name }}/;
|
proxy_pass {{ trim $proto }}://{{ trim $container.Name }}/;
|
||||||
{{ else }}
|
{{ else }}
|
||||||
proxy_pass {{ trim $proto }}://{{ trim $container.Name }};
|
proxy_pass {{ trim $proto }}://{{ trim $container.Name }};
|
||||||
|
|
Loading…
Reference in a new issue