Infini-OPTIPLEX/jellyfin: fix nginx proxy configuration
This commit is contained in:
parent
cc40492235
commit
12f9ec6fa5
1 changed files with 24 additions and 0 deletions
|
@ -3,20 +3,44 @@ let
|
||||||
address = "127.0.0.1";
|
address = "127.0.0.1";
|
||||||
port = 8096;
|
port = 8096;
|
||||||
jellyfin = "http://${address}:${toString port}";
|
jellyfin = "http://${address}:${toString port}";
|
||||||
|
proxyConfig = ''
|
||||||
|
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-Protocol $scheme;
|
||||||
|
proxy_set_header X-Forwarded-Host $http_host;
|
||||||
|
'';
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
services.nginx.virtualHosts."jellyfin.inx.moe" = config.common.nginx.ssl // {
|
services.nginx.virtualHosts."jellyfin.inx.moe" = config.common.nginx.ssl // {
|
||||||
|
extraConfig = ''
|
||||||
|
client_max_body_size 20M;
|
||||||
|
'';
|
||||||
|
|
||||||
locations."= /" = {
|
locations."= /" = {
|
||||||
return = "302 https://$host/web/";
|
return = "302 https://$host/web/";
|
||||||
};
|
};
|
||||||
|
|
||||||
locations."/" = {
|
locations."/" = {
|
||||||
proxyPass = jellyfin;
|
proxyPass = jellyfin;
|
||||||
|
recommendedProxySettings = false;
|
||||||
|
extraConfig = proxyConfig + ''
|
||||||
|
proxy_buffering off;
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
locations."= /web/" = {
|
||||||
|
proxyPass = "${jellyfin}/web/index.html";
|
||||||
|
recommendedProxySettings = false;
|
||||||
|
extraConfig = proxyConfig;
|
||||||
};
|
};
|
||||||
|
|
||||||
locations."/socket" = {
|
locations."/socket" = {
|
||||||
proxyPass = jellyfin;
|
proxyPass = jellyfin;
|
||||||
proxyWebsockets = true;
|
proxyWebsockets = true;
|
||||||
|
recommendedProxySettings = false;
|
||||||
|
extraConfig = proxyConfig;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue