summaryrefslogtreecommitdiffstats
path: root/krebs/2configs/mastodon-proxy.nix
blob: 35bf6020dae546602df2e17debc5d7bfd6bb37ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{ config, lib, pkgs, ... }:
{
  services.nginx = {
    enable = true;
    virtualHosts."social.krebsco.de" = {
      forceSSL = true;
      enableACME = true;
      acmeFallbackHost = "hotdog.r";
      locations."/" = {
        # TODO use this in 22.11
        # recommendedProxySettings = true;
        proxyPass = "http://hotdog.r";
        proxyWebsockets = true;
        extraConfig = ''
          proxy_set_header        Host $host;
          proxy_set_header        X-Real-IP $remote_addr;
          proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
          proxy_set_header        X-Forwarded-Proto $scheme;
          proxy_set_header        X-Forwarded-Host $host;
          proxy_set_header        X-Forwarded-Server $host;
        '';
      };
    };
  };
}