Jellyfin Forum
Can Jellyfin be reserver proxy by a node express server? - Printable Version

+- Jellyfin Forum (https://forum.jellyfin.org)
+-- Forum: Support (https://forum.jellyfin.org/f-support)
+--- Forum: Troubleshooting (https://forum.jellyfin.org/f-troubleshooting)
+--- Thread: Can Jellyfin be reserver proxy by a node express server? (/t-can-jellyfin-be-reserver-proxy-by-a-node-express-server)



Can Jellyfin be reserver proxy by a node express server? - duanyu5871 - 2023-10-31

I have a jellyfin server and web in docker work properly, It can be accessed with [u]http://192.168.10.217:8096/[/u] or other direct reserver proxy from nginx.
However, I build a self-using website with login server. It also link to some docker applications which share the same hostname with different Base URL. Nodejs and express module was used to hold webserver, and reserver proxy was used to pass connection to each application. However, only jellyfin cannot work properly with this reserver proxy.
Code:
const { createProxyMiddleware } = require('http-proxy-middleware');

etc ...


app.use('/dy',sendLoginUser, createProxyMiddleware({
  target: 'http://localhost:3838',
  changeOrigin: true,

}));

app.use('/olddy',sendLoginUser, createProxyMiddleware({
  target: 'http://localhost:3838',
  changeOrigin: true,
}));

app.use('/vnc/',sendLoginUser, createProxyMiddleware({
  target: 'http://192.168.10.217:6901',
  changeOrigin: true,
  ws: true,
  pathRewrite: {
      '^/vnc' : ''    // rewrite path 
  },
}));


app.use('/jelly/',sendLoginUser, createProxyMiddleware({
  target: 'http://192.168.10.217:8096/',
  ws: true,
  logLevel: 'debug',
}));


other application can work normally, but not jellyfin. It can show all static html like login or some other webpage like follow, but cannot actually login:

Jellyfin Version
10.8.9

Environment
- OS: Linux- Linux Kernel: Ubuntu- Virtualization: Docker- Clients: Browser- Browser: Chrome

[b]Jellyfin logs[/b]
[2023-10-30 22:21:38.996 +08:00] [ERR] [35] Jellyfin.Server.Middleware.ExceptionMiddleware: Error processing request: "Reading the request body timed out due to data arriving too slowly. See MinRequestBodyDataRate". URL "POST" "/Users/authenticatebyname".
[2023-10-30 22:21:39.004 +08:00] [WRN] [35] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from "http://192.168.10.217/jelly/Users/authenticatebyname" to "172.17.0.4" in 0:00:05.1823004 with Status Code 500
[2023-10-30 22:28:52.835 +08:00] [INF] [34] Emby.Server.Implementations.Session.SessionWebSocketListener: Sending ForceKeepAlive message to 1 inactive WebSockets.
[2023-10-30 22:29:52.836 +08:00] [INF] [34] Emby.Server.Implementations.Session.SessionWebSocketListener: Sending ForceKeepAlive message to 1 inactive WebSockets.
[2023-10-30 22:30:52.839 +08:00] [INF] [43] Emby.Server.Implementations.Session.SessionWebSocketListener: Sending ForceKeepAlive message to 1 inactive WebSockets.
[2023-10-30 22:31:52.843 +08:00] [INF] [43] Emby.Server.Implementations.Session.SessionWebSocketListener: Sending ForceKeepAlive message to 1 inactive WebSockets.
[2023-10-30 22:32:52.845 +08:00] [INF] [48] Emby.Server.Implementations.Session.SessionWebSocketListener: Sending ForceKeepAlive message to 1 inactive WebSockets.
[2023-10-30 22:33:52.847 +08:00] [INF] [77] Emby.Server.Implementations.Session.SessionWebSocketListener: Sending ForceKeepAlive message to 1 inactive WebSockets.
[2023-10-30 22:34:52.848 +08:00] [INF] [35] Emby.Server.Implementations.Session.SessionWebSocketListener: Sending ForceKeepAlive message to 1 inactive WebSockets.
[2023-10-30 22:35:52.851 +08:00] [INF] [81] Emby.Server.Implementations.Session.SessionWebSocketListener: Sending ForceKeepAlive message to 1 inactive WebSockets.
[2023-10-30 22:36:52.853 +08:00] [INF] [86] Emby.Server.Implementations.Session.SessionWebSocketListener: Sending ForceKeepAlive message to 1 inactive WebSockets.
[2023-10-30 22:37:52.853 +08:00] [INF] [35] Emby.Server.Implementations.Session.SessionWebSocketListener: Sending ForceKeepAlive message to 1 inactive WebSockets.
[2023-10-30 22:38:52.857 +08:00] [INF] [36] Emby.Server.Implementations.Session.SessionWebSocketListener: Sending ForceKeepAlive message to 1 inactive WebSockets.
[2023-10-30 22:39:52.860 +08:00] [INF] [88] Emby.Server.Implementations.Session.SessionWebSocketListener: Sending ForceKeepAlive message to 1 inactive WebSockets.
[2023-10-30 22:40:52.861 +08:00] [INF] [16] Emby.Server.Implementations.Session.SessionWebSocketListener: Sending ForceKeepAlive message to 1 inactive WebSockets.
[2023-10-30 22:41:52.864 +08:00] [INF] [16] Emby.Server.Implementations.Session.SessionWebSocketListener: Sending ForceKeepAlive message to 1 inactive WebSockets.
[2023-10-30 22:42:05.161 +08:00] [ERR] [42] Jellyfin.Server.Middleware.ExceptionMiddleware: Error processing request: "Reading the request body timed out due to data arriving too slowly. See MinRequestBodyDataRate". URL "POST" "/Users/authenticatebyname".
[2023-10-30 22:42:05.161 +08:00] [WRN] [42] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from "http://192.168.10.217/jelly/Users/authenticatebyname" to "172.17.0.4" in 0:00:05.1360064 with Status Code 500
[2023-10-30 22:42:13.163 +08:00] [ERR] [30] Jellyfin.Server.Middleware.ExceptionMiddleware: Error processing request: "Reading the request body timed out due to data arriving too slowly. See MinRequestBodyDataRate". URL "POST" "/Users/authenticatebyname".
[2023-10-30 22:42:13.163 +08:00] [WRN] [30] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from "http://192.168.10.217/jelly/Users/authenticatebyname" to "172.17.0.4" in 0:00:05.9671941 with Status Code 500
[2023-10-30 22:42:20.164 +08:00] [ERR] [30] Jellyfin.Server.Middleware.ExceptionMiddleware: Error processing request: "Reading the request body timed out due to data arriving too slowly. See MinRequestBodyDataRate". URL "POST" "/Users/authenticatebyname".
[2023-10-30 22:42:20.165 +08:00] [WRN] [30] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from "http://192.168.10.217/jelly/Users/authenticatebyname" to "172.17.0.4" in 0:00:05.4678799 with Status Code 500

[b]Please attach any browser or client logs here[/b]
proceeding to page: /jelly/web#!/login.html
main.jellyfin.bundle.js?0dc5892538410e85c5da:2 returning instance from getOrAddApiClient
main.jellyfin.bundle.js?0dc5892538410e85c5da:2 Requesting url without automatic networking: [u]http://192.168.10.217:3000/jelly/QuickConnect/Enabled[/u]
main.jellyfin.bundle.js?0dc5892538410e85c5da:2 Requesting url without automatic networking: [u]http://192.168.10.217:3000/jelly/users/public[/u]
main.jellyfin.bundle.js?0dc5892538410e85c5da:2 Requesting url without automatic networking: [u]http://192.168.10.217:3000/jelly/Branding/Configuration[/u]
main.jellyfin.bundle.js?0dc5892538410e85c5da:2 Error opening web socket: Error: Cannot open web socket without access token.
main.jellyfin.bundle.js?0dc5892538410e85c5da:2 returning instance from getOrAddApiClient
main.jellyfin.bundle.js?0dc5892538410e85c5da:2 Requesting url without automatic networking: [u]http://192.168.10.217:3000/jelly/Users/authenticatebyname[/u]
authenticatebyname:1 Failed to load resource: the server responded with a status of 500 (Internal Server Error)
index.html#!/login.html?serverid=48750af9633c4cf3ae15b18081c28937:1 Autofocus processing was blocked because a document already has a focused element.
main.jellyfin.bundle.js?0dc5892538410e85c5da:2 Error opening web socket: Error: Cannot open web socket without access token.


[font=-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji']Can you help me about this issue