-
Notifications
You must be signed in to change notification settings - Fork 70
Expand file tree
/
Copy pathnginx.conf
More file actions
40 lines (35 loc) · 1.04 KB
/
Copy pathnginx.conf
File metadata and controls
40 lines (35 loc) · 1.04 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
server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.html;
# Fumadocs inlines the navigation tree and the RSC payload into every page,
# so pages are ~290 KB raw but ~27 KB gzipped. The search index is 8.6 MB
# raw / 1.4 MB gzipped. Serving these uncompressed is not viable.
gzip on;
gzip_comp_level 6;
gzip_min_length 1024;
gzip_vary on;
gzip_proxied any;
gzip_types
text/plain
text/css
text/markdown
application/json
application/javascript
application/octet-stream
image/svg+xml;
# text/html is always compressed by nginx and must not be listed here
# Serve the home page directly. Without this, the `index index.html`
# fallback below rewrites "/" to "/index.html", which the redirect rule
# then bounces to "/index".
location = / {
try_files /index.html =404;
}
location ~ ^(.+)\.html$ {
return 301 $1;
}
location / {
try_files $uri $uri.html $uri/ =404;
}
}