I need to access my Seafile server using two different URLs: the local IP address when I’m on my home network ( and my domain name when I’m away from home.
Can this be done by just enabling NAT loopback on my router? If I cant do this on my router what are my options here?
Thanks.
AFAIK you can’t have 2 different hostnames both work for the same seafile server. There are times when the server will generate addresses for your browser to follow, and it will use the one hostname from your config files.
What you need is for the same hostname to work from both internal and external networks. There’s a few ways to do this. One is NAT loopback which will allow a connection from the internal network to work the same as if it had come from the external network.
Another option is to override the DNS for you server’s hostname within your local network. This way you have seafile.mydomain.com resolve to the internal IP for the reverse proxy when you are on your local network, and when you are on the external network using any other DNS server, the DNS points to your public IP.
1 Like
The second option is obviously more efficient, because traffic is not routed through your router but goes more direct, at most hitting the switch of the router but not all routing logic, conn tracking, etc.
Basically you override the hostnames of your home/corp router. Then internal clients are using it and see the internal IP. Clients outside the network use external DNS so see the public IP.
The trick is that browsers nowadays may use DNS over HTTPS which may break this setup. But you can as well disable this.