[ops] Add nginx placeholders for unfurlbot configuration

This commit is contained in:
wiz
2022-08-27 13:54:07 +02:00
parent 69d4ba18d5
commit bba9f2608a
4 changed files with 18 additions and 28 deletions

View File

@@ -59,7 +59,7 @@ location = / {
# cache /resources/** for 1 week since they don't change often
location ~ ^/[a-z][a-z]/resources/(.*) {
try_files $uri /en-US/resources/$1 =404;
expires 1w;
expires 1w;
}
# cache /<lang>/main.f40e91d908a068a2.js forever since they never change
location ~ ^/([a-z][a-z])/(.+\..+\.(js|css)) {
@@ -69,11 +69,14 @@ location ~ ^/([a-z][a-z])/(.+\..+\.(js|css)) {
# cache everything else for 5 minutes
location ~ ^/([a-z][a-z])$ {
try_files $uri /$1/index.html /en-US/index.html =404;
expires 5m;
expires 5m;
}
location ~ ^/([a-z][a-z])/ {
if ($unfurlbot) {
proxy_pass $mempoolSpaceUnfurler;
}
try_files $uri /$1/index.html /en-US/index.html =404;
expires 5m;
expires 5m;
}
# cache /resources/** for 1 week since they don't change often
@@ -89,6 +92,9 @@ location ~* ^/.+\..+\.(js|css) {
# catch-all for all URLs i.e. /address/foo /tx/foo /block/000
# cache 5 minutes since they change frequently
location / {
if ($unfurlbot) {
proxy_pass $mempoolSpaceUnfurler;
}
try_files /$lang/$uri $uri /en-US/$uri /en-US/index.html =404;
expires 5m;
}