···11+{ config, ... }:
22+{
33+ services.caddy.virtualHosts."cloud.lilac.pink".extraConfig = ''
44+ encode
55+ reverse_proxy ${config.garden.info.network.lily.netbird-ip}:80 {
66+ # NixOS uses nginx as a webserver for NextCloud by default and nginx will send 301 redirects to the client
77+ # using http as the protocol instead of https since it doesn't have SSL certs of its own.
88+ # Because the redirect isn't also https, this can cause a Content-Security-Policy error on the client.
99+ # In practice this prevents us from enabling apps on NextCloud without this line.
1010+ header_down Location http:// https://
1111+ }
1212+ '';
1313+}