forked from uc-cdis/gen3.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf
50 lines (43 loc) · 1.33 KB
/
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
##
# Logging Settings
# Note that this file actually winds up at
# /etc/nginx/conf.d/nginx.conf
# , and is loaded by /etc/nginx/nginx.conf in an http{} block
##
log_format aws '$http_x_forwarded_for - $http_x_userid [$time_local] '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent"';
access_log /dev/stdout aws;
server {
listen 80 default_server;
#listen 443 ssl;
#ssl_certificate /mnt/ssl/nginx.crt;
#ssl_certificate_key /mnt/ssl/nginx.key;
index index.html index.htm;
# Block all access to things like .git or .htaccess
location ~ /\. {
deny all;
}
location ~* \.(?:manifest|appcache|html?|xml|json)$ {
expires -1;
root /usr/share/nginx/html;
# access_log logs/static.log; # I don't usually include a static log
}
location ~* \.(?:css|js)$ {
try_files $uri =404;
expires 1y;
access_log off;
add_header Cache-Control "public";
root /usr/share/nginx/html;
}
# Any route containing a file extension (e.g. /devicesfile.js)
location ~ ^.+\..+$ {
try_files $uri =404;
root /usr/share/nginx/html;
}
# Any route that doesn't have a file extension (e.g. /devices)
location / {
try_files $uri /index.html;
root /usr/share/nginx/html;
}
}