-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathnginx.conf
More file actions
65 lines (52 loc) · 1.54 KB
/
nginx.conf
File metadata and controls
65 lines (52 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# required to run in a container
daemon off;
user www-data;
worker_processes 4;
pid /run/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
}
http {
# basic settings
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
server_names_hash_bucket_size 64;
gzip on;
gzip_disable "msie6";
include /etc/nginx/mime.types;
default_type application/octet-stream;
# send logs to STDOUT so they can be seen using 'docker logs'
access_log /dev/stdout;
error_log /dev/stdout;
server {
listen 80 default_server;
server_name _; # will never match
server_name_in_redirect off;
}
# service definitions for each application
{{ range $service := .deis_services }}{{ if $service.Nodes }}
upstream {{ Base $service.Key }} {
{{ range $upstream := $service.Nodes }}server {{ $upstream.Value }};
{{ end }}
}
server {
server_name ~^{{ Base $service.Key }}\.(?<domain>.+)$;
server_name_in_redirect off;
port_in_redirect off;
location / {
proxy_buffering off;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_redirect off;
proxy_connect_timeout 10;
proxy_send_timeout 30;
proxy_read_timeout 30;
proxy_pass http://{{ Base $service.Key }};
}
}
{{ end }}{{ end }}
}