summaryrefslogtreecommitdiff
path: root/depo/nutin-madaj/web.nix
blob: 899200ce8f210818436d477b34cf4f9d5dab6228 (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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
{ ... }:

let
  bensIp = "68.107.97.20"; # hidor-kahih
in
{
  services = {
    nginx = {
      enable = true;
      recommendedGzipSettings = true;
      recommendedOptimisation = true;
      recommendedProxySettings = true;
      recommendedTlsSettings = true;
      virtualHosts = {
        "bsima.me".root = "/home/ben/public_html/";
        "www.bsima.me".root = "/home/ben/public_html/";
        "simatime.com".locations."/".root = "/srv/www/";
        "znc.simatime.com".locations."^(.*)$".proxyPass = "http://localhost/znc$1";
        "hero.simatime.com".locations."/".proxyPass = "http://${bensIp}:3001";
        "tv.simatime.com".locations."/".proxyPass = "http://${bensIp}:8096"; # emby runs on port 8096

        "notebook.simatime.com".locations = {
          "/" = {
            proxyPass = "http://${bensIp}:3099";
            proxyWebsockets = true;
            extraConfig = ''
              proxy_buffering off;
              proxy_read_timeout 86400;

            '';
          };
          "/(api/kernels/[^/]+/channels|terminals/websocket)/" = {
            proxyPass = "http://${bensIp}:3099";
            proxyWebsockets = true;
          };
        };
      };
    };
  };
}