Post #438,186
1/16/21 12:01:41 PM
1/16/21 12:01:41 PM
|
I am about to ask a series of very stupid questions about how the internet works.
I currently have a home server that is hosting a Nextcloud instance that is in use by several family members. It's locked down pretty strongly (only open port is the web interface, non encrypted and weakly encrypted traffic is disabled, passwords are exceedingly long line noise, updates are automatically installed daily) and I'd like to experiment a little more with it. If I have a no-ip account such as foo.ddns.net pointing at the home server which is running NGINX, and I want to have a series of subdomains such as: nc.foo.ddns.netbw.foo.ddns.netbl.foo.ddns.netCan I just get away with just setting up multiple configuration files under NGINX each hosting its own subdomain, or do I need to install and configure a DNS (and expose it to the world) and have each entry pointing to the external address of my current server? I'm guessing the latter, but hoping for the former.
Ceterum autem censeo pars Republican esse delendam.
|
Post #438,188
1/17/21 4:42:07 PM
1/17/21 4:42:58 PM
|
dns just points to an ip address
so if you want to have a series of subdomains (not sure why) you can add nc.foo.ddns.netbw.foo.ddns.netbl.foo.ddns.netto your /etc/hosts file pointing to your internal ip address have your family also edit their own host entries on their own systems to match what you have. Not sure about nginx but apache I would add virtual hosts for each of the names with a different docroot pointing to different parts of the webserver seems like a lot of work for not much benefit but I am not sure of what problem you are trying to solve
"Science is the belief in the ignorance of the experts" – Richard Feynman
Edited by boxley
Jan. 17, 2021, 04:42:41 PM EST
Edited by boxley
Jan. 17, 2021, 04:42:58 PM EST
|
Post #438,193
1/17/21 8:07:51 PM
1/17/21 8:07:51 PM
|
I'm lazy.
Either I teach myself to hack NGINX config files so I can move my Nextcloud instance to foo.ddns.net/nc or I teach myself to hack DNS so I can move it to nc.foo.ddns.net. Don't really care much myself which one it is other than that it's the easy way; the main point is to allow me to hang more services off that server. Just kind of my own self-education project that leaves me vulnerable to getting my server pwned. (Thinking about setting up a Bitwarden instance, a blog, possibly getting a real domain and setting up an email server, that kind of thing.)
Ceterum autem censeo pars Republican esse delendam.
|
Post #438,201
1/18/21 7:02:34 PM
1/18/21 7:02:34 PM
|
I think you can't avoid fiddling with the Nginx config
If I understood the original request correctly, you only have on IP so all those subdomains will resolve to that same address. It will be up to Nginx to sort out which site instance belongs to which subdomain.
|
Post #438,202
1/19/21 12:45:33 AM
1/19/21 12:46:39 AM
|
The difference is how it's handled.
I've already got Nextcloud up and working at foo.ddns.net - using subdomains like " nc.foo.ddns.net" is easier (single line change, literally) than moving it to foo.ddns.net/nc, which requires picking apart the config file with a fine tooth comb as near as I can tell. From the docs I have grokked so far, you can put each subdomain in its own config file, completely separate from the other files, and they won't conflict with each other. Edited to add - one of the things I loathe about being self-taught through experimentation and just randomly stumbling on to things is that I don't always know the proper terminology, have no idea where to look for things, and have this fear deep down inside that I'm leaving my pants around my ankles.
Ceterum autem censeo pars Republican esse delendam.
Edited by InThane
Jan. 19, 2021, 12:46:39 AM EST
|
Post #438,189
1/17/21 5:23:31 PM
1/17/21 5:23:31 PM
|
Unless nginx is very different from Apache, should be the easy option
DNS gets then to your box, config on the box gets them to the subdomain. I don't figure you want to talk your relatives through editing their hosts files.
|
Post #438,190
1/17/21 6:12:39 PM
1/17/21 6:12:39 PM
|
May need a cert for each
Unless you have a *.foo.ddns.net wildcard cert in place, each subdomain would need its own cert.
|
Post #438,192
1/17/21 7:54:21 PM
1/17/21 7:54:21 PM
|
Oh, wasn't thinking about certs
|
Post #438,194
1/17/21 8:08:15 PM
1/17/21 8:08:15 PM
|
Already using letsencrypt.
Ceterum autem censeo pars Republican esse delendam.
|
Post #438,196
1/17/21 11:38:43 PM
1/17/21 11:38:43 PM
|
You don't really want to run your own DNS server.
That gets you tangled up in delegation, transfers and other things to do with the name service system. If you have an account to let you create sub-domains under someone else's domain name, that is far far easier.
Nginx lets you do virtual hosts so you can just point all your names at the same IP address and let the web server and web browser figure it out. Which they will.
Wade.
|