-
Notifications
You must be signed in to change notification settings - Fork 57
/
nginx.conf
63 lines (53 loc) · 2.1 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
55
56
57
58
59
60
61
62
63
server {
# Redirect alternative domains to scrumlr.io
listen ${SCRUMLR_LISTEN_PORT};
listen [::]:${SCRUMLR_LISTEN_PORT};
server_name beta.scrumlr.io scrumler.io scrumlr.de;
location / {
return 301 https://scrumlr.io$request_uri;
}
}
server {
listen ${SCRUMLR_LISTEN_PORT} default_server;
listen [::]:${SCRUMLR_LISTEN_PORT} default_server;
server_name _;
root /usr/share/nginx/html;
index index.html index.htm;
gzip on;
gzip_vary on;
gzip_comp_level 6;
gzip_types text/plain text/css text/xml application/json application/javascript application/rss+xml application/atom+xml image/svg+xml;
gzip_proxied no-cache no-store private expired auth;
gzip_min_length 1024;
gzip_disable "MSIE [1-6]\.";
location / {
try_files $uri $uri/ /index.html;
add_header Cache-Control "no-store, no-cache, must-revalidate";
}
location /index.html {
# Application specific feature toggles
add_header Set-Cookie "scrumlr__show-legal-documents=${SCRUMLR_SHOW_LEGAL_DOCUMENTS};Path=/;Max-Age=3600";
add_header Set-Cookie "scrumlr__server-url=${SCRUMLR_SERVER_URL};Path=/;Max-Age=3600";
add_header Set-Cookie "scrumlr__websocket-url=${SCRUMLR_WEBSOCKET_URL};Path=/;Max-Age=3600";
add_header Set-Cookie "scrumlr__analytics_data_domain=${SCRUMLR_ANALYTICS_DATA_DOMAIN};Path=/;Max-Age=3600";
add_header Set-Cookie "scrumlr__analytics_src=${SCRUMLR_ANALYTICS_SRC};Path=/;Max-Age=3600";
# Disable caching for index.html
add_header Cache-Control "no-store, no-cache, must-revalidate";
add_header Pragma no-cache;
expires 0;
}
location ~* \.(js|json)$ {
# Cache JS and JSON files for 3 days
expires 3d;
add_header Cache-Control "public, must-revalidate";
}
location ~* \.(jpg|jpeg|gif|png|svg|css)$ {
# Cache other media files for 14 days
expires 14d;
add_header Cache-Control "public";
}
location ~* \.(ico|mp3)$ {
# Cache .mp3 and .ico files for 365 days
add_header Cache-Control "max-age=36792000, public";
}
}