From e620c20b34b6d721171e2d409c3bff6e13f2a037 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 15 Sep 2021 11:50:51 +0200 Subject: [PATCH] nginx.conf --- nginx.conf.sigil | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/nginx.conf.sigil b/nginx.conf.sigil index 2ed9d21e..9d5f7dc6 100644 --- a/nginx.conf.sigil +++ b/nginx.conf.sigil @@ -1,10 +1,14 @@ -{{ range $port_map := .PROXY_PORT_MAP | split " " }} -{{ $port_map_list := $port_map | split ":" }} +{{ $port_map := .PROXY_PORT_MAP | split " " }} +{{ $port_map_list := index $port_map 0 | split ":" }} {{ $scheme := index $port_map_list 0 }} {{ $listen_port := index $port_map_list 1 }} {{ $upstream_port := index $port_map_list 2 }} -location / { +{{ $listeners := index $.DOKKU_APP_WEB_LISTENERS 0 | split " " }} +{{ $listener_list := $listeners | split ":" }} +{{ $listener_ip := index $listener_list 0 }} + +location /graphql { gzip on; gzip_min_length 1100; @@ -13,7 +17,7 @@ location / { gzip_vary on; gzip_comp_level 6; - proxy_pass http://{{ $.APP }}-{{ $upstream_port }}; + proxy_pass http://{{ $listener_ip }}:{{ $upstream_port }}; proxy_http_version 1.1; proxy_read_timeout {{ $.PROXY_READ_TIMEOUT }}; proxy_buffer_size {{ $.PROXY_BUFFER_SIZE }}; @@ -27,6 +31,4 @@ location / { proxy_set_header X-Forwarded-Port {{ $.PROXY_X_FORWARDED_PORT }}; proxy_set_header X-Forwarded-Proto {{ $.PROXY_X_FORWARDED_PROTO }}; proxy_set_header X-Request-Start $msec; -} - -{{ end }} \ No newline at end of file +} \ No newline at end of file