this post was submitted on 19 Jun 2025
163 points (98.8% liked)

Selfhosted

48767 readers
995 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 2 years ago
MODERATORS
 

I'm pretty new to selfhosting and homelabs, and I would appreciate a simple-worded explanation here. Details are always welcome!

So, I have a home network with a dynamic external IP address. I already have my Synology NAS exposed to the Internet with DDNS - this was done using the interface, so didn't require much technical knowledge.

Now, I would like to add another server (currently testing with Raspberry Pi) in the same LAN that would also be externally reachable, either through a subdomain (preferable), or through specific ports. How do I go about it?

P.S. Apparently, what I've tried on the router does work, it's just that my NAS was sitting in the DMZ. Now it works!

(page 3) 7 comments
sorted by: hot top controversial new old
[–] [email protected] 10 points 1 week ago

You can either:

A) Use a different port, just set up the new service to run on a port that's not used by the other service.

B) If it's a TCP service use a reverse proxy and a subdomain.

[–] [email protected] 12 points 1 week ago (4 children)

If you mean HTTP server, what you need is a reverse proxy and name-based virtual hosts. I usually use nginx for such tasks, but you may choose another web server that has these features.

load more comments (4 replies)
[–] [email protected] 2 points 1 week ago (3 children)

If you have a prosumer router I suggest you to use the ddns in the router plus a reverse proxy. This would be the cleanest solution.

If you can not, once everything is working with your external access to the synology, the dsm has a built-in reverse proxy so it can redirect http requests to another server. Although this proxy is really simple and limited it can get the work done if you setup is simple enough.

load more comments (3 replies)
[–] [email protected] 8 points 1 week ago* (last edited 1 week ago) (7 children)

Router gets the public IP. Login to it, find port forwarding option. You'll pick a public port. IE 443 and forward it to a local IP:port combo, IE 192.168.0.101:443.

Then you can pick another public port and forward it to a different private IP:port combo.

If you want a subdomain, you forward one port to one host and have it do the work. IE configure Nginx to do whatever you want.

EDIT: or you use IPv6. Everything is a public IP.

load more comments (7 replies)
[–] [email protected] 69 points 1 week ago (9 children)

You need a reserve proxy. That's a piece of software that takes the requests and puts them toward the correct endpoint.

You need to create port forwards in the router and direct 80 and 443 (or whatever you're using) toward the host of the reverse proxy and that is listening to on those ports. If it recognized the requests are for nas.your.domain, it will forward the requests to the NAS.

Common reverse proxies are nginx or caddy. You can install it on your raspberry, it doesn't need it's own device.

If you don't want that, you can create different port forwards on your router (e.g. 8080 and 8443 to the Raspi) and configure your service on the Raspi corresponding. But it doesn't scale well and you'd need to call everything with the port and the reverse proxy is the usual solution.

load more comments (9 replies)
[–] [email protected] 1 points 1 week ago (1 children)

You'll need to direct that port for the given service in the router control panel.

For your current server you have a port forwarding for that port already. Just add a port forwarding rule for the new service.

[–] [email protected] 1 points 1 week ago* (last edited 1 week ago) (4 children)

Tried doing that - here's how I've set it up:

Expected behavior: now when I enter :8100, I reach 192.168.0.113:81

Real behavior: connection times out

load more comments (4 replies)
load more comments
view more: ‹ prev next ›