Repository navigation
Expand file tree
/
Copy pathnginx.conf
More file actions
53 lines (43 loc) · 1.47 KB
/
Copy pathnginx.conf
File metadata and controls
53 lines (43 loc) · 1.47 KB
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
map_hash_bucket_size 512;
map_hash_max_size 65536;
map $uri $cache_control {
default "public, max-age=3600, stale-while-revalidate=86400";
/pagefind/pagefind-entry.json "no-cache";
~^/uploads/ "public, max-age=31536000, immutable";
~^/images/emoji/ "public, max-age=31536000, immutable";
~^/pagefind/(index|fragment)/ "public, max-age=31536000, immutable";
~^/pagefind/.*\.pf_meta$ "public, max-age=31536000, immutable";
~^/(assets|pagefind)/ "public, max-age=86400";
}
map $uri $reply_redirect {
default "";
include /etc/nginx/reply-redirects.map;
}
server {
listen 8080;
listen [::]:8080;
server_name _;
root /srv/archive;
index index.html;
charset utf-8;
server_tokens off;
absolute_redirect off;
tcp_nopush on;
open_file_cache max=10000 inactive=5m;
open_file_cache_valid 5m;
open_file_cache_errors on;
gzip_static on;
gzip_vary on;
gzip_proxied any;
add_header Cache-Control $cache_control;
add_header X-Content-Type-Options nosniff;
add_header Referrer-Policy no-referrer always;
error_page 404 /404.html;
location / {
# The generated map also locates replies on continuation pages.
if ($reply_redirect) {
return 301 $reply_redirect;
}
try_files $uri $uri/index.html =404;
}
}