-
-
Notifications
You must be signed in to change notification settings - Fork 302
Expand file tree
/
Copy pathdefault.conf
More file actions
45 lines (35 loc) · 1.35 KB
/
default.conf
File metadata and controls
45 lines (35 loc) · 1.35 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
# DO NOT RENAME: referenced by docker/nginx/entrypoint.sh
# assume development
location @emulator {
include /etc/nginx/includes/content/_proxy.conf;
# for the storage emulator, we actually want `/content` in the path
# because it's used as the bucket name
# this is the magic that allows us to intercept errors and try the next location
proxy_intercept_errors on;
recursive_error_pages on;
error_page 404 = @hotfixes;
proxy_pass http://minio:9000;
}
location @hotfixes {
include /etc/nginx/includes/content/_proxy.conf;
# this is the magic that allows us to intercept errors and try the next location
proxy_intercept_errors on;
recursive_error_pages on;
error_page 404 = @production;
# use LE domain to ensure Cloudflare is in between
proxy_pass https://hotfixes.studio.learningequality.org;
}
location @production {
include /etc/nginx/includes/content/_proxy.conf;
# use LE domain to ensure Cloudflare is in between
proxy_pass https://studio.learningequality.org;
}
location @nowhere {
return 404;
}
location /content/ {
# check the emulator bucket first, then cloud development bucket, then fall back to production
# try_files will only use one named route, and it uses the last one. Although, we can't just
# pass one named route, because it fails.
try_files @nowhere @emulator;
}