~jb55/citadel

08b4de37de0ef9b51aa9bda9b0e63906d6c0c9f9 — William Casarin 1 year, 1 month ago 13888c2
monad: enable plex

Signed-off-by: William Casarin <jb55@jb55.com>
1 files changed, 32 insertions(+), 3 deletions(-)

M nix-config/machines/monad/networking/default.nix
M nix-config/machines/monad/networking/default.nix => nix-config/machines/monad/networking/default.nix +32 -3
@@ 115,7 115,7 @@ in
  };

  services.plex = {
    enable = false;
    enable = true;
    group = "transmission";
    openFirewall = true;
  };


@@ 158,13 158,42 @@ in
        # set some headers and proxy stuff.
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_redirect off;
				proxy_set_header X-Forwarded-Proto $scheme;
				proxy_set_header Host $server_addr;
				proxy_set_header Referer $server_addr;
				proxy_set_header Origin $server_addr; 

        # plex headers
				proxy_set_header X-Plex-Client-Identifier $http_x_plex_client_identifier;
				proxy_set_header X-Plex-Device $http_x_plex_device;
				proxy_set_header X-Plex-Device-Name $http_x_plex_device_name;
				proxy_set_header X-Plex-Platform $http_x_plex_platform;
				proxy_set_header X-Plex-Platform-Version $http_x_plex_platform_version;
				proxy_set_header X-Plex-Product $http_x_plex_product;
				proxy_set_header X-Plex-Token $http_x_plex_token;
				proxy_set_header X-Plex-Version $http_x_plex_version;
				proxy_set_header X-Plex-Nocache $http_x_plex_nocache;
				proxy_set_header X-Plex-Provides $http_x_plex_provides;
				proxy_set_header X-Plex-Device-Vendor $http_x_plex_device_vendor;
				proxy_set_header X-Plex-Model $http_x_plex_model;

				# Websockets
				proxy_http_version 1.1;
				proxy_set_header Upgrade $http_upgrade;
				proxy_set_header Connection "upgrade";

				# Buffering off send to the client as soon as the data is received from Plex.
				proxy_redirect off;
				proxy_buffering off;

				client_max_body_size 100M;
				send_timeout 100m;

        # include Host header
        proxy_set_header Host $host;

        # proxy request to plex server
        proxy_pass http://127.0.0.1:32400;
        proxy_pass http://plex.jb55.com:32400/;
      }
    }