post(caddy): dedup config

This commit is contained in:
MDLeom 2020-11-12 22:22:26 +00:00
parent 4d98701970
commit d50f580cc5
No known key found for this signature in database
GPG Key ID: 32D3E28E96A695E8
1 changed files with 14 additions and 37 deletions

View File

@ -464,23 +464,19 @@ Since I also set up reverse proxy for {% post_link tor-hidden-onion-nixos 'Tor O
header_up User-Agent "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" header_up User-Agent "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
} }
(oneWeekCache) { (reverseProxy) {
Cache-Control "max-age=604800, public" reverse_proxy https://{args.0} {
import removeHeaders
header_up Host "{args.0}"
}
} }
(pathProxy) { (pathProxy) {
header /js/* { @staticFiles {
import oneWeekCache path *.css *.gif *.ico *.jpg *.js *.png *.svg *.webp *.xml
defer
} }
header @staticFiles {
header /css/* { Cache-Control "max-age=604800, public"
import oneWeekCache
defer
}
header /svg/* {
import oneWeekCache
defer defer
} }
@ -492,35 +488,16 @@ Since I also set up reverse proxy for {% post_link tor-hidden-onion-nixos 'Tor O
handle_path /img/* { handle_path /img/* {
rewrite * /img/gitlab.com/curben/blog/raw/site{path} rewrite * /img/gitlab.com/curben/blog/raw/site{path}
reverse_proxy https://cdn.statically.io { import reverseProxy cdn.statically.io
import removeHeaders
header_up Host cdn.statically.io
}
}
header /img/* {
import oneWeekCache
defer
} }
handle_path /screenshot/* { handle_path /screenshot/* {
rewrite * /screenshot/curben.netlify.app{path}?mobile=true rewrite * /screenshot/curben.netlify.app{path}?mobile=true
reverse_proxy https://cdn.statically.io { import reverseProxy cdn.statically.io
import removeHeaders
header_up Host cdn.statically.io
}
} }
header /screenshot/* { import reverseProxy curben.netlify.app
import oneWeekCache
defer
}
reverse_proxy https://curben.netlify.app {
import removeHeaders
header_up Host curben.netlify.app
}
} }
``` ```