-
Notifications
You must be signed in to change notification settings - Fork 3
/
docs.deepfence.io.conf
59 lines (45 loc) · 1.88 KB
/
docs.deepfence.io.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
proxy_cache_path /var/www/docs-cache keys_zone=docsapicache:1m;
server {
listen 80;
server_name docs.deepfence.io;
rewrite ^/docs/threatmapper/(.*)$ /threatmapper/docs/$1 permanent;
rewrite ^/threatmapper/docs/v2.5/(.*)$ /threatmapper/docs/$1 redirect;
rewrite ^/threatstryker/docs/v2.5/(.*)$ /threatstryker/docs/$1 redirect;
error_page 404 /404.html;
location = /404.html {
root /var/www/html;
internal;
}
location /gh-cache/ {
proxy_pass https://api.github.com/;
proxy_set_header Host api.github.com;
proxy_set_header Authorization "Basic ${GITHUB_BASIC_AUTH}";
proxy_cache docsapicache;
add_header X-Cache-Status $upstream_cache_status;
# GH responses have cache-control: private, making them uncacheable
proxy_ignore_headers Cache-Control;
# cache 200, 301, 302 responses for 1m
# errors (e.g. 403 rate limit exceeded) will not be cached
proxy_cache_valid 1m;
# return previous valid response if we get a rate limit
# error, or other error type
proxy_cache_use_stale error timeout http_500 http_503 http_504 http_403 http_429;
}
location /dh-cache/ {
proxy_pass https://hub.docker.com/;
proxy_set_header Host hub.docker.com;
proxy_cache docsapicache;
add_header X-Cache-Status $upstream_cache_status;
add_header Access-Control-Allow-Origin *;
# cache 200, 301, 302 responses for 1m
# errors (e.g. 403 rate limit exceeded) will not be cached
proxy_cache_valid 1m;
# return previous valid response if we get a rate limit
# error, or other error type
proxy_cache_use_stale error timeout http_500 http_503 http_504 http_403 http_429;
}
location / {
# the contents of the build process from Docusaurus
root /var/www/html;
}
}