-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdev-nginx.conf.template
65 lines (53 loc) · 1.38 KB
/
dev-nginx.conf.template
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
# Mock HTTPS load balancer in front of Varnish
server {
server_name ${NGINX_LB_HOST};
listen ${NGINX_LB_PORT} default_server;
listen [::]:${NGINX_LB_PORT} default_server;
listen ${NGINX_LB_SSL_PORT} ssl;
listen [::]:${NGINX_LB_SSL_PORT} ssl;
http2 on;
ssl_certificate server.crt;
ssl_certificate_key server.key;
# reverse proxy to Varnish
location / {
proxy_pass ${NGINX_LB_PROXY_PASS};
}
}
# Mock Backend
server {
listen ${NGINX_BACK_PORT};
listen [::]:${NGINX_BACK_PORT};
server_name ${NGINX_BACK_HOST};
root /usr/share/nginx/html;
# health check
location /health {
return 200 healthy;
}
location /varnish_health {
return 200 healthy;
}
# homepage
location / {
# index index.html index.htm;
return 200 homepage;
}
# feed
location /podcast/feed {
# rewrite ^(.*)$ /index.html last;
return 200 feed”;
}
# admin
location /admin {
absolute_redirect off;
return 302 / ;
}
# redirect server error pages to the static page /50x.html
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
# reverse proxy somewhere else
location ${NGINX_BACK_REV_PROXY_LOC_MATCH} {
proxy_pass ${NGINX_BACK_REV_PROXY};
}
}