Point subdomain to home server

#1

Nextcloud version 15.0.7
Operating system and version Ubuntu 18.04
NC Snap install

Hi all,

I’ve just installed NC with Snap on a new Ubuntu install on a home laptop. I can access and login to the admin area at:
http://localhost

Now I want to point a subdomain to it so I access it securely via HTTPS over the internet.

I’ve pointed:
nc.example.com
to my static IP
whatsmydns.net confirms it’s pointed to the correct IP

I’m now unsure what my next steps are. I have a tp-link router and have set the internal IP of the server as a static IP. I think my next step is to set-up port forwarding, I’m not too sure how to go about that. Can anyone point me in the right direction?

Update…

I’ve opened ports 80 & 443 in UFW with:
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp

In my router:
Forwarding > Virtual Servers
Service port = 80
Internal port = 80
IP Address = 192.168.0.100
Protocol = TCP

Service port = 443
Internal port = 443
IP Address = 192.168.0.100
Protocol = TCP

On visiting
nc.example.com

I’m getting: ERR_NAME_NOT_RESOLVED

Cheers,
Leon

#2

Because you did not tell your internal name server that nc.example.com has ip address 192.168.0.100

#3

How would I do that?

#4

So I’ve added nc.example.com and 192.168.0.100 with:

System config value trusted_domains => 1 set to string nc.example.com
System config value trusted_domains => 2 set to string 192.168.0.100

I can login on the LAN with the 192.168.0.100
but nc.example.com gives me:
ERR_CONNECTION_REFUSED

#5

what is the result of

host nc.axample.com

#6

Leon, did you try to access your nextcloud from outside your lan? If that works you, you might need this: https://ownyourbits.com/2017/03/09/dnsmasq-as-dns-cache-server-for-nextcloudpi-and-raspbian/

#7

@Sanook host nc.example.com is as expected

I’ve contacted my ISP (a small company), he thinks the problem may be on their end. I’ll update this thread once I know more…

#8

@LeonM are you not able to connect from outside your network either? You normally can not connect the domain from inside your own network without dnsmasq afaik

#9

Yes, in your LAN. But from outside of your LAN?

#10

This issue is now resolved.

Although I had a static IP in as much as it never changed, it wasn’t a public facing IP. My ISP has now given me a new static public facing IP and after fixing my WAN router settings the subdomain works as expected without doing anything else.

Thanks to those that offered advice.