sin0/redlib: add settings

This commit is contained in:
Guanran Wang 2024-10-05 20:13:21 +08:00
parent 46ad3cad7e
commit 31d6a1ec80
Signed by: nyancat
GPG key ID: 91F97D9ED12639CF

View file

@ -9,19 +9,18 @@ in
address = "127.0.0.1"; address = "127.0.0.1";
}; };
services.caddy.settings.apps.http.servers.srv0.routes = lib.singleton { systemd.services."redlib".environment = {
match = lib.singleton { host = [ "reddit.ny4.dev" ]; };
handle = [
{
# Google's indexing caused a DoS with 800k requests... # Google's indexing caused a DoS with 800k requests...
# https://developers.google.com/search/docs/crawling-indexing/block-indexing # https://developers.google.com/search/docs/crawling-indexing/block-indexing
handler = "headers"; REDLIB_ROBOTS_DISABLE_INDEXING = "on";
response.set."X-Robots-Tag" = [ "noindex" ]; REDLIB_DEFAULT_USE_HLS = "on";
} };
{
services.caddy.settings.apps.http.servers.srv0.routes = lib.singleton {
match = lib.singleton { host = [ "reddit.ny4.dev" ]; };
handle = lib.singleton {
handler = "reverse_proxy"; handler = "reverse_proxy";
upstreams = [ { dial = "localhost:${toString port}"; } ]; upstreams = [ { dial = "localhost:${toString port}"; } ];
} };
];
}; };
} }