summaryrefslogtreecommitdiffstats
path: root/krebs/2configs/mastodon-proxy.nix
blob: 4d359c3fe05507fe48fa5c1fba41d09a1174c16a (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
{ config, lib, pkgs, ... }:
{
  services.nginx = {
    enable = true;
    virtualHosts."social.krebsco.de" = {
      forceSSL = true;
      enableACME = true;
      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;
        '';
      };
    };
  };
}