Skip to content

Commit

Permalink
nginx config
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Oct 29, 2019
1 parent 17b07b7 commit 0e36a8e
Showing 1 changed file with 2 additions and 39 deletions.
41 changes: 2 additions & 39 deletions nginx.conf.sigil
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
{{ $listen_port := index $port_map_list 1 }}
{{ $upstream_port := index $port_map_list 2 }}

{{ if eq $scheme "http" }}
server {
listen [::]:{{ $listen_port }};
listen {{ $listen_port }};
Expand Down Expand Up @@ -50,7 +49,7 @@ server {
internal;
}
}
{{ else if eq $scheme "https"}}

server {
listen [::]:{{ $listen_port }} ssl {{ if eq $.HTTP2_SUPPORTED "true" }}http2{{ else if eq $.SPDY_SUPPORTED "true" }}spdy{{ end }};
listen {{ $listen_port }} ssl {{ if eq $.HTTP2_SUPPORTED "true" }}http2{{ else if eq $.SPDY_SUPPORTED "true" }}spdy{{ end }};
Expand Down Expand Up @@ -113,42 +112,6 @@ server {
internal;
}
}
{{ else if eq $scheme "grpc"}}
{{ if eq $.GRPC_SUPPORTED "true"}}{{ if eq $.HTTP2_SUPPORTED "true"}}
server {
listen [::]:{{ $listen_port }} http2;
listen {{ $listen_port }} http2;
{{ if $.NOSSL_SERVER_NAME }}server_name {{ $.NOSSL_SERVER_NAME }}; {{ end }}
access_log {{ $.NGINX_LOG_ROOT }}/{{ $.APP }}-access.log;
error_log {{ $.NGINX_LOG_ROOT }}/{{ $.APP }}-error.log;
location / {
grpc_pass grpc://{{ $.APP }}-{{ $upstream_port }};
}
include {{ $.DOKKU_ROOT }}/{{ $.APP }}/nginx.conf.d/*.conf;
}
{{ end }}{{ end }}
{{ else if eq $scheme "grpcs"}}
{{ if eq $.GRPC_SUPPORTED "true"}}{{ if eq $.HTTP2_SUPPORTED "true"}}
server {
listen [::]:{{ $listen_port }} ssl http2;
listen {{ $listen_port }} ssl http2;
{{ if $.NOSSL_SERVER_NAME }}server_name {{ $.NOSSL_SERVER_NAME }}; {{ end }}
access_log {{ $.NGINX_LOG_ROOT }}/{{ $.APP }}-access.log;
error_log {{ $.NGINX_LOG_ROOT }}/{{ $.APP }}-error.log;

ssl_certificate {{ $.APP_SSL_PATH }}/server.crt;
ssl_certificate_key {{ $.APP_SSL_PATH }}/server.key;
ssl_protocols TLSv1.2 {{ if eq $.TLS13_SUPPORTED "true" }}TLSv1.3{{ end }};
ssl_prefer_server_ciphers off;

location / {
grpc_pass grpc://{{ $.APP }}-{{ $upstream_port }};
}
include {{ $.DOKKU_ROOT }}/{{ $.APP }}/nginx.conf.d/*.conf;
}
{{ end }}{{ end }}
{{ end }}
{{ end }}

{{ if $.DOKKU_APP_LISTENERS }}
{{ range $upstream_port := $.PROXY_UPSTREAM_PORTS | split " " }}
Expand All @@ -158,4 +121,4 @@ upstream {{ $.APP }}-{{ $upstream_port }} {
{{ $listener_ip := index $listener_list 0 }}
server {{ $listener_ip }}:{{ $upstream_port }};{{ end }}
}
{{ end }}{{ end }}
{{ end }}

0 comments on commit 0e36a8e

Please sign in to comment.