-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf
34 lines (28 loc) · 978 Bytes
/
nginx.conf
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
server {
# Only listen to local http as the External load balancers do TLS on :443 for us
listen 80;
server_name localhost;
client_max_body_size 200M;
client_body_buffer_size 128k;
# When traffic comes through load balancers make sure it came in via TLS or respond 301
if ($http_x_forwarded_proto = 'http') {
return 301 https://$host$request_uri;
}
# A basic response for the load balancer to check NGINX is running
location /loadbalancer {
default_type application/json;
root /usr/share/nginx;
index loadbalancer;
}
# Try send all traffic through index.html
location / {
root /usr/share/nginx/html/niwaweather;
index index.html;
try_files $uri $uri/ /index.html?$query_string;
}
# Anything not caught gets an error response
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}