I am running syncthing via Docker and connecting to it on local net using android. It works flawlessly (directly setting the “addresses” from dynamic to tcp://HOST:PORT)
I setup nginx for the UI to access it outside my network, but am not able to get that working for the 22000 port (yet). Part of my process is to temporarily forward 22000 in my router and access it directly that way, but I’m not having any luck.
It’s not giving me an error on the connection page (not sure where to look for logs currently on android…), so I’m not sure what the issue is. Any help would be appreciated
Did you switch from dynamic to a static address because of connectivity issues?
So, note that Nginx is a web server rather than a general-purpose packet filter.
In a reverse-proxy setup, Nginx responds like a web server to the web client while at the same time acting like a web client to the back end web server. Syncthing’s web UI is served by a built-in web server using the default port 8384, so it works fine with Nginx which also talks HTTP. But Syncthing’s BEP is something entirely different and isn’t recognized by Nginx.
Leaving Syncthing’s settings to their defaults (device addresses field is “dynamic”) including enabling global and local discovery on both the Docker container and Android would have been sufficient in most cases to get them to automatically connect while on the same LAN and when apart.
I did find my issue actually, when I set up syncthing originally, I set it to only work for local addresses. I reset that to allow all IPs and I got it working lol.
As for nginx, yeah you’re right, but there is a way to stream tcp traffic (just not path based like I was trying to do). Gonna get that set up later this week
Sounds like you’re referring to HTTP tunneling. Nginx will still be communicating via HTTP, and it requires a suitable proxy between Nginx and Syncthing.
It’s an interesting experiment, but not sure if it provides any real utility unless there’s a need for your phone to be able to reach Syncthing on your LAN from within a network that forces all connections thru a HTTP proxy.
Sounds like you’re referring to HTTP tunneling. Nginx will still be communicating via HTTP, and it requires a suitable proxy between Nginx and Syncthing.
It’s an interesting experiment, but not sure if it provides any real utility unless there’s a need for your phone to be able to reach Syncthing on your LAN from within a network that forces all connections thru a HTTP proxy.
Not sure if it’s tunneling exactly, but to give reference, this is what I’m doing in my nginx config:
stream {
upstream apisync {
server localhost:22000;
}
server {
listen 1234;
proxy_pass apisync;
}
}
Proxies 1234 tcp traffic to localhost:22000. While it’s simpler to
just have the 22000 port open in my router, I wanted a centralized logging of network traffic so I can see who/what is connecting all in one place lol