nginx.conf

This commit is contained in:
root 2021-09-15 11:50:51 +02:00
parent 6830db2bc5
commit e620c20b34

View File

@ -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 }};
@ -28,5 +32,3 @@ location / {
proxy_set_header X-Forwarded-Proto {{ $.PROXY_X_FORWARDED_PROTO }};
proxy_set_header X-Request-Start $msec;
}
{{ end }}