Seafile 12 - no acces in local network

I managed to setup seafile 12 with docker in a proxmox lxc.
It works fine while i access the server from outside. In the local network, I am redirected to the address of the router in the browser. I use a myfritz.net accout. The router has an external adress like xxx.myfritz.net.
Opening the ports 80 and 443, the router redirects me to the seafile-server, when I try to access the seafile website.
In the yaml-files I named the server-url like this “xxx.myfritz.net”.
I already tried to change the ports like “8060:80” for http and “8443:443” for https in the caddy.yml, but that doesn’t work.
What can I do to get access to seafile from local network?

I think you have 2 options, and you might want to actually do both.

Option 1 - NAT reflection (sometimes called hairpin NAT). This is a configuration in your router so that when you try to access your router’s public address from inside of your network it forwards the ports on just like it does when you access that public IP from outside. The way you set this up is different on different routers.

On some routers I’ve used, getting this to work correctly required moving the router’s own configuration web interface off to another port. Basically the internal web server would start before the rules, so it would already have port 443, so the firewall rules weren’t able to grab port 443 on the internal interface and forward it to the reverse proxy. That’s probably good because if it had I wouldn’t be able to access the router’s config anymore.

Option 2 - DNS. You can configure your local DNS server to give the IP of your reverse proxy when asked for “xxx.myfritz.net”. So when you are outside of your local network, you use a normal DNS, and get your public IP. When you are inside of your network, you use your internal DNS which points you directly to the server without going through the router at all.

I actually set up both of those because I had some programs that didn’t want to use the internal DNS I had configured. For example I was playing with DNS over https in firefox, so it wasn’t using my internal DNS server.

Hi.
Thank you very much for your answer.
Option 2 works for me :grinning:
Have a nice day

Oh - wait a minute…
Working with my browser, i have access also from local network. Fine.
But seafile clients don’t get a connection anymore in local network.
The smartphone app gives me an error: permission denied. Code 3001
How can I fix that?

My guess is that the phone is using some other DNS even if it has been told to use your local one. My old phone did that, but my current one doesn’t. I don’t know how you would know for sure other than to just use something like wireshark to capture the traffic so you can see what DNS server the phone is talking to, and what IP it uses when trying to talk to seafile.

I am not sure why the client on the computer would have a problem, but it might be the same problem. So it might be worth setting up the NAT reflection to cover cases like this where the DNS isn’t enough.