about summary refs log blame commit diff
path: root/ops/modules/www/cs.tvl.fyi.nix
blob: fac814baf0645b927697bcdb15203ae5f125927e (plain) (tree)
1
2
3
4
5
6
7
8
9
10









                                                
                                      



















                                                                                         
{ config, ... }:

{
  imports = [
    ./base.nix
  ];

  config = {
    services.nginx.virtualHosts."cs.tvl.fyi" = {
      serverName = "cs.tvl.fyi";
      serverAliases = [ "cs.tvl.su" ];
      enableACME = true;
      forceSSL = true;

      extraConfig = ''
        location = / {
          return 301 https://cs.tvl.fyi/depot;
        }

        location / {
          proxy_set_header X-Sg-Auth "Anonymous";
          proxy_pass http://localhost:${toString config.services.depot.sourcegraph.port};
        }

        location /users/Anonymous/settings {
          return 301 https://cs.tvl.fyi;
        }
      '';
    };
  };
}