Subdomain redirect to specific IP

Hi,

Not sure if this possible and how to arrange this, but hopely somebody can point me a direction.

I’ve Nethsecurity as my firewall/gateway in VM and 2 VM’s behind the firewall

I want to forward a subdomain to a internal server by IP
for example

webmail.domain.nl → 192.168.1.2/SOGo
nextcloud.domain.nl → 192.168.1.3/nextcloud

is this possible ? and where do i need to do this ?
Must this be done in Nethsecurity?

This could be possible using Reverse Proxy on NethSec, see Certificates and reverse proxy — NethSecurity documentation

3 Likes

I’m a bit new on this topic.
Do i need to change at my domain records ? Or are all subdomain forwared to the main IP and then seperated by the reverse proxy ?

I’ve tried the following

2024-05-07 22_04_50-NethSec8 - NethSecurity

When I browse to https://webmail.pdebrabander.nl it goes to
https://webmail.pdebrabander.nl/webmail/

2024-05-07 22_06_09-404 Not Found

Yes, exactly.

Here is an example of a reverse proxy pointing to my NAS that hosts an NS7 mirror.

You could try to add a trailing slash / in the destination URL or try without the /webmail path (just to see if it works in general)
Which webmail software is running at 192.168.1.2/webmail ? NS7 Roundcube?

1 Like

Hi mrmarkuz,

Redirecting of the domain to the IP is working (needs a bit more testing)
But redirect to /webmail by a subdomain not.
I’ll try the extra slash / the next few days

I’m using Kopano on ClearOS as webmail.
A very good package which i like to keep for a bit longer.
I’m not very happy with Sogo or Webtop at the moment. A bit more limited then Kopano

1 Like

It appears to be working now.

I’ve added a / behind the IP
image

will do some more testing the coming days

Except for Nextcloud

Still adding /nextcloud behind the url
https://nextcloud.pdebrabander.nl/nextcloud/index.php/login

Maybe you can configure Nextcloud to not use a path?

For example in NS7 Nextcloud could be configured to just use a virtual host name like nextcloud.domain.tld without the /nextcloud path, see Nextcloud — NethServer 7 Final

1 Like