david_666 1 Posted October 20, 2023 Posted October 20, 2023 I have a Emby server on Windows with port 8098 and a Nginx server before it with port 2345, they are on same machine then I install Emby Android app on my mobile phone and configure server address: http://192.168.51.39:2345, and everything is ok But after I restart Emby Android app, the server address has been changed to http://192.168.51.39:8098 automatically !! I want to know why the app change the server address? It seems the app use the Nginx upstream address as the server address, am I make some mistakes in configuration ? All the devices are in the same LAN Arch: Emby Android -> Nginx -> Emby Server Emby server version: 4.8.0.54 Emby Andrord version: 3.3.39 ========== Nginx Conf Begin ============= server{ gzip on; listen 2345; listen [::]:2345; server_name default; ## The default `client_max_body_size` is 1M, this might not be enough for some posters, etc. client_max_body_size 20M; add_header 'Referrer-Policy' 'no-referrer'; set $emby http://192.168.51.39:8098; #emby/jellyfin address # Proxy sockets traffic for jellyfin-mpv-shim and webClient location ~ /(socket|embywebsocket) { # Proxy emby/jellyfin Websockets traffic proxy_pass $emby; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; 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; } location ~* /web/index.html { proxy_buffering off; js_body_filter addExternalUrl.incloudUrl buffer_type=string; proxy_pass $emby; proxy_pass_request_body off; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; 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; proxy_set_header Accept-Encoding "identity"; proxy_set_header X-Original-URI $request_uri; js_header_filter addExternalUrl.HeaderFilter; } location @backend { proxy_pass $emby; } ... } ========== Nginx Conf Begin =============
rbjtech 4810 Posted October 20, 2023 Posted October 20, 2023 So I believe the App is likely doing a broadcast (on the same LAN) when it starts (I'm not sure..) - and is 'finding' the server directly - thus bypassing the proxy. We would need the Dev's to confirm this theory. To force it to use the proxy - maybe block incoming traffic on the emby host and only allow it from the proxy ?
Luke 38825 Posted October 20, 2023 Posted October 20, 2023 4 hours ago, rbjtech said: So I believe the App is likely doing a broadcast (on the same LAN) when it starts (I'm not sure..) - and is 'finding' the server directly - thus bypassing the proxy. We would need the Dev's to confirm this theory. To force it to use the proxy - maybe block incoming traffic on the emby host and only allow it from the proxy ? That is correct. 1
david_666 1 Posted October 20, 2023 Author Posted October 20, 2023 thank for your quick reply, i know how to solve it~
Luke 38825 Posted October 21, 2023 Posted October 21, 2023 7 hours ago, david_666 said: thank for your quick reply, i know how to solve it~ Just curious, what is the solution?
david_666 1 Posted October 23, 2023 Author Posted October 23, 2023 On 10/21/2023 at 8:43 AM, Luke said: Just curious, what is the solution? lol, very simple, i block the port 8098 in firewall config of my windows server 1
rbjtech 4810 Posted October 23, 2023 Posted October 23, 2023 2 hours ago, david_666 said: lol, very simple, i block the port 8098 in firewall config of my windows server On 20/10/2023 at 10:09, rbjtech said: To force it to use the proxy - maybe block incoming traffic on the emby host and only allow it from the proxy ? As I said above, blocking the traffic is a sure way of forcing the issue You could block the tcp 8098 - you could also block the udp 1900
hjason7812 28 Posted October 24, 2023 Posted October 24, 2023 On 10/20/2023 at 3:34 AM, david_666 said: I have a Emby server on Windows with port 8098 and a Nginx server before it with port 2345, they are on same machine then I install Emby Android app on my mobile phone and configure server address: http://192.168.51.39:2345, and everything is ok But after I restart Emby Android app, the server address has been changed to http://192.168.51.39:8098 automatically !! I want to know why the app change the server address? It seems the app use the Nginx upstream address as the server address, am I make some mistakes in configuration ? All the devices are in the same LAN Arch: Emby Android -> Nginx -> Emby Server Emby server version: 4.8.0.54 Emby Andrord version: 3.3.39 ========== Nginx Conf Begin ============= server{ gzip on; listen 2345; listen [::]:2345; server_name default; ## The default `client_max_body_size` is 1M, this might not be enough for some posters, etc. client_max_body_size 20M; add_header 'Referrer-Policy' 'no-referrer'; set $emby http://192.168.51.39:8098; #emby/jellyfin address # Proxy sockets traffic for jellyfin-mpv-shim and webClient location ~ /(socket|embywebsocket) { # Proxy emby/jellyfin Websockets traffic proxy_pass $emby; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; 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; } location ~* /web/index.html { proxy_buffering off; js_body_filter addExternalUrl.incloudUrl buffer_type=string; proxy_pass $emby; proxy_pass_request_body off; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; 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; proxy_set_header Accept-Encoding "identity"; proxy_set_header X-Original-URI $request_uri; js_header_filter addExternalUrl.HeaderFilter; } location @backend { proxy_pass $emby; } ... } ========== Nginx Conf Begin ============= Seems like you didn't save the server address when you changed it. That's why it changed back to the default server address.
rbjtech 4810 Posted October 24, 2023 Posted October 24, 2023 3 hours ago, hjason7812 said: Seems like you didn't save the server address when you changed it. That's why it changed back to the default server address. Pls see above, it has nothing to do with 'saving'...
hjason7812 28 Posted October 24, 2023 Posted October 24, 2023 1 hour ago, rbjtech said: Pls see above, it has nothing to do with 'saving'... I did read above ot looks like you didn't save or you did and it didn't take. I have done thay before and thought something was wrong with the server too.
rbjtech 4810 Posted October 24, 2023 Posted October 24, 2023 (edited) 6 hours ago, hjason7812 said: I did read above ot looks like you didn't save or you did and it didn't take. I have done thay before and thought something was wrong with the server too. With an App - you don't manually 'save' anything - you just connect to the service and next time it will use that same connection. However, BEFORE that connection prompt even displays, the App does a network broadcast - and if the connection exists, and has a previous authenticated connection, it will use that instead. ie it will ignore any proxy connection. This is what the OP is referring to - and has solved by blocking the 'direct' connection. It has nothing to do with 'saving' the connection. Edited October 24, 2023 by rbjtech
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now