1

First off, let me apologise if this is too simple a question. I'm sure it is, but my main problem is that I don't really know the exact terminology to use to search for an answer.

For the past few years, I've run a home server to provide me with a few services; namely Plex, Owncloud(recently changed to Nextcloud), a Webmin server to give a GUI, and a small mailserver solely to give me updates of system notifications.

Until now, I've accessed everything by just using the server ip followed by either the name of the service (in the case of Nextcloud, for example, I simply navigate to https://192.168.1.50/nextcloud) or the port (webmin is https://192.168.1.50:10000 while Plex is https://192.168.50:32400)

I've been wanting to use bind9 to set up a dns server to allow me to access everything by a domain name rather than by its IP address, and having a few hours to myself today I bit the bullet and started off.

I've got the DNS server itself working ok. From my laptop, I can ping either ubuntuserver (the host name of my server) or ubuntuserver.local.ftb, with local.ftb being my chosen domain.

Please note that this is not intended to be accessible outside of my local network, it is solely an internal setup.

I have also set up dns records for webmin.ubuntuserver.local.ftb, nextcloud.ubuntuserver.local.ftb and plex.ubuntuserver.local.ftb and have them pointing to my main server 192.168.1.50

My question is, can I set up Apache in such a way as to point https://webmin.ubuntuserver.local.ftb to https://192.168.1.50:10000, https://nextcloud.ubuntuserver.local.ftb to https://192.168.1.50/nextcloud and https://plex.ubuntuserver.local.ftb to https://192.168.1.50:32400? I presume this redirection wouldn't be handled by the DNS server since it doesn't seem to deal with ports, but is it possible with Apache?

1 Answer 1

0

Yes, Apache as well as Nginx support "reverse proxying", where you can route requests based on the whole VirtualHost (the request's Host header) or even specific paths only. Look up the ProxyPass directive.

(Note that the clients only connect to Apache, i.e. the front end – the individual services' ports do not need to be accessible from outside.)

Another option, exclusive to TLS connections (but not necessarily HTTPS) is to route based on the hostname within the TLS SNI field. Haproxy, Nginx, stunnel, and sniproxy are capable of this – I've used them to share a port between HTTPS and IRC-SSL at one time.

2
  • Thanks, I'll have a search for info on proxypass
    – Will
    Apr 9, 2017 at 19:31
  • Not a full answer and it still took quite a bit of digging but since this set me down the path, have an accepted answer to add to your already enormous rep total.
    – Will
    Apr 11, 2017 at 20:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .