-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy pathnginx.conf
54 lines (43 loc) · 1.38 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
51
52
53
54
server {
listen 4939;
listen [::]:4939;
server_name localhost;
location /health {
return 200;
}
# disregard port when redirecting
port_in_redirect off;
# general settings
charset UTF-8;
# static hosting settings
root /usr/share/nginx/html;
index index.html;
# static hosting optimizations
sendfile on;
tcp_nopush on;
tcp_nodelay on;
# size settings
types_hash_max_size 2048;
large_client_header_buffers 4 32k;
client_max_body_size 100m;
# gzip
gzip on;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss image/svg+xml text/javascript;
# Don't include assets when disabling the cache. We do this because:
# - We add a content hash to our JS assets.
# - Our images (including our spritesheet) are versioned.
# - Most of our styles are injected as a style element.
location ~* \.(jpg|png|js|css)$ {}
# disable cache and redirect URLs that don't match a file to index.html
location / {
# This is to disable the cache. We might only need the Cache-Control header,
# but caching is my enemy and I want to make sure it's turned off. Pulled
# from https://stackoverflow.com/a/45285696.
add_header Last-Modified $date_gmt;
add_header Cache-Control 'no-store, no-cache';
if_modified_since off;
expires off;
etag off;
try_files $uri $uri/ /;
}
}