forked from isaacphysics/isaac-code-editor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf
63 lines (45 loc) · 1.59 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
user nginx;
worker_processes auto;
error_log /dev/stdout error;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '[$time_local] $status "$http_x_forwarded_for" "$request"';
access_log /var/log/nginx/access.log main;
sendfile on;
keepalive_timeout 65;
# Do not use etags for caching:
etag off;
# Last-Modified is always added anyway.
server {
listen 80;
server_name localhost;
error_log /var/log/nginx/error.log;
root /usr/share/nginx/html;
location /static {
add_header Cache-Control "public, max-age=2592000, no-transform";
try_files $uri @default;
}
location /index.html {
# Index page, and also serves unknown URLs too from @default.
# Do not allow caching of these index pages at all:
add_header Cache-Control "no-cache, no-store, must-revalidate";
try_files $uri @default;
}
location / {
# Allow caching, but require revalidation every time:
add_header Cache-Control "no-cache, must-revalidate";
try_files $uri @default;
}
location @default {
# Unknown files not found by any of the try_files above.
# No headers can be added in this block, since they won't be used.
# Rewrite all unknown requests to the relevant index page:
rewrite .* /index.html last;
}
}
}