nginx optimization and collabora fucking works!
This commit is contained in:
parent
2c709940a4
commit
ae5b577fe3
@ -6,8 +6,9 @@
|
|||||||
let
|
let
|
||||||
localhost = "127.0.0.1";
|
localhost = "127.0.0.1";
|
||||||
workstation = "192.168.1.64";
|
workstation = "192.168.1.64";
|
||||||
jellyfinPort = "8096";
|
jellyfinPort = 8096;
|
||||||
nextcloudPort = 80;
|
nextcloudPort = 80;
|
||||||
|
collaboraPort = 9980;
|
||||||
flamePort = 5005;
|
flamePort = 5005;
|
||||||
secretFlamePort = 5007;
|
secretFlamePort = 5007;
|
||||||
lidarrPort = 8686;
|
lidarrPort = 8686;
|
||||||
@ -104,7 +105,9 @@ in {
|
|||||||
|
|
||||||
location = /web/ {
|
location = /web/ {
|
||||||
# Proxy main Jellyfin traffic
|
# Proxy main Jellyfin traffic
|
||||||
proxy_pass http://${localhost}:${jellyfinPort}/web/index.html;
|
proxy_pass http://${localhost}:${
|
||||||
|
toString (jellyfinPort)
|
||||||
|
}/web/index.html;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
@ -115,11 +118,11 @@ in {
|
|||||||
'';
|
'';
|
||||||
locations = {
|
locations = {
|
||||||
"/" = {
|
"/" = {
|
||||||
proxyPass = "http://${localhost}:${jellyfinPort}";
|
proxyPass = "http://${localhost}:${toString (jellyfinPort)}";
|
||||||
proxyWebsockets = true;
|
proxyWebsockets = true;
|
||||||
};
|
};
|
||||||
"/socket" = {
|
"/socket" = {
|
||||||
proxyPass = "http://${localhost}:${jellyfinPort}";
|
proxyPass = "http://${localhost}:${toString (jellyfinPort)}";
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
@ -127,7 +130,7 @@ in {
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
"~ /Items/(.*)/Images" = {
|
"~ /Items/(.*)/Images" = {
|
||||||
proxyPass = "http://${localhost}:${jellyfinPort}";
|
proxyPass = "http://${localhost}:${toString (jellyfinPort)}";
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
proxy_cache jellyfin;
|
proxy_cache jellyfin;
|
||||||
proxy_cache_revalidate on;
|
proxy_cache_revalidate on;
|
||||||
@ -135,7 +138,7 @@ in {
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
"~* ^/Videos/(.*)/(?!live)" = {
|
"~* ^/Videos/(.*)/(?!live)" = {
|
||||||
proxyPass = "http://${localhost}:${jellyfinPort}";
|
proxyPass = "http://${localhost}:${toString (jellyfinPort)}";
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
# Set size of a slice (this amount will be always requested from the backend by nginx)
|
# Set size of a slice (this amount will be always requested from the backend by nginx)
|
||||||
# Higher value means more latency, lower more overhead
|
# Higher value means more latency, lower more overhead
|
||||||
@ -170,12 +173,42 @@ in {
|
|||||||
enableACME = true;
|
enableACME = true;
|
||||||
serverAliases = [ "cloud.rotehaare.art" ];
|
serverAliases = [ "cloud.rotehaare.art" ];
|
||||||
http2 = true;
|
http2 = true;
|
||||||
# locations = {
|
locations = {
|
||||||
# "/".proxyWebsockets = true;
|
"/".proxyWebsockets = true;
|
||||||
# # uh, equals what?
|
# uh, equals what?
|
||||||
# "~ ^/nextcloud/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|oc[ms]-provider/.+|.+/richdocumentscode/proxy).php(?:$|/)" =
|
"~ ^/nextcloud/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|oc[ms]-provider/.+|.+/richdocumentscode/proxy).php(?:$|/)" =
|
||||||
# { };
|
{ };
|
||||||
# };
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
"collabora.servidos.lat" = let
|
||||||
|
collaboraString = "http://${localhost}:${toString (collaboraPort)}";
|
||||||
|
collaboraProxy = {
|
||||||
|
proxyPass = collaboraString;
|
||||||
|
extraConfig = ''
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
collaboraSocket = {
|
||||||
|
proxyPass = collaboraString;
|
||||||
|
extraConfig = ''
|
||||||
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
proxy_set_header Connection "Upgrade";
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_read_timeout 36000s;
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
in base {
|
||||||
|
# static files
|
||||||
|
"^~ /loleaflet" = collaboraProxy;
|
||||||
|
# WOPI discovery URL
|
||||||
|
"^~ /hosting/discovery" = collaboraProxy;
|
||||||
|
# Capabilities
|
||||||
|
"^~ /hosting/capabilities" = collaboraProxy;
|
||||||
|
# download, presentation, image upload and websocket
|
||||||
|
"~ ^/lool" = collaboraSocket;
|
||||||
|
# Admin Console websocket
|
||||||
|
"^~ /lool/adminws" = collaboraSocket;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user