-
Notifications
You must be signed in to change notification settings - Fork 0
/
docs-nginx.conf
43 lines (33 loc) · 1.07 KB
/
docs-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
user root;
worker_processes 16;
events {
worker_connections 8192;
}
http {
include /etc/nginx/mime.types;
server {
gzip on;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
listen 8002;
server_name docs;
index index.html;
# content location
root /app/docs;
# exact matches -> reverse clean urls -> folders -> not found
try_files $uri $uri.html $uri/ =404;
# non existent pages
error_page 404 /404.html;
# a folder without index.html raises 403 in this setup
error_page 403 /404.html;
location ^~/docs/ {
rewrite ^/docs/(.*)$ /$1 break;
}
# add cors & anti caching header for local dev
location ~* / {
add_header Access-Control-Allow-Origin "http://localhost:8080";
add_header Cache-Control: "no-cache, no-store, must-revalidate";
add_header Pragma no-cache;
expires 0;
}
}
}