-
Notifications
You must be signed in to change notification settings - Fork 1
/
nginx.conf.example
46 lines (38 loc) · 1.13 KB
/
nginx.conf.example
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
proxy_cache_path /etc/nginx/cache levels=1:2 keys_zone=main_cache:10m max_size=1g inactive=60m use_temp_path=off;
server {
listen 80;
listen [::]:80;
server_name sml.lc;
gzip on;
location = / {
return 301 https://smallcdn.rocks;
}
location = /github {
proxy_set_header X-Update-Libraries "true";
proxy_pass http://localhost:3000;
}
location ~ \/(ping-no-cache|ping) {
return 200 "pong";
}
location ^~ /api {
proxy_pass http://localhost:3001;
}
location ~ \/(?<library>.+)\/(?<file>.+)$ {
proxy_set_header X-Library-Name $library;
proxy_set_header X-Library-File $file;
proxy_ignore_headers "Set-Cookie";
proxy_hide_header "Set-Cookie";
proxy_cache main_cache;
proxy_cache_use_stale error timeout invalid_header;
proxy_pass http://localhost:3000;
}
location ~ \/(?<library>.+)$ {
proxy_set_header X-Library-Name $library;
proxy_set_header X-Library-File "";
proxy_ignore_headers "Set-Cookie";
proxy_hide_header "Set-Cookie";
proxy_cache main_cache;
proxy_cache_use_stale error timeout invalid_header;
proxy_pass http://localhost:3000;
}
}