would be good if you can share the web server used
I recall a longer discussion with a user on GitHub about a similar setup. Maybe you can have a look.
Puhh, ja I remember one case where I instructed a user how to do it and one year later during another web application install he ran into a then expected error and it took quite a while to remember that special setup and fix things. Note that there is not really any reason why a subdomain would be better to split applications compared to sub directories. For security reasons (to marke scraping a little harder), sub directories are actually better and easier to handle regarding HTTPS certificates and webserver-side settings/hardenings in general. Sub domains make sense when you use different physical servers which run different applications for the same domain/organisation, otherwise they will make things more complicated.
There are multiple ways to achieve it, via proxy, via rewrites or by changing the webroot, and the Nextcloud config needs to be altered. It depends hence whether Nextcloud is and will always be the same web application/website on that system or if you plan to add other ones, now or in the future.
Just reviving this thread to get a little insights in the best way to turn a dietpi subfolder installation into a subdomain one (using nginx).
Where would I need to look?
I found this
This works for nextcloud.
But: after I applied the changes, I can no longer open the pihole admin page under internalIP/admin.
Thanks in advance l.
This is correct and expected because you have customised the web server document root and therefore the PiHole admin page can no longer be found.
Can this expected behaviour be resolved by changing the nginx configuration?
Your webroot was
/var/www, inside there was
/nextcloud. Your root is now
/nextcloud, you are not able to reach the “sibling” folders. just revert you changes and you are able to reach it again.
Btw why use a subdomain? It works with a subfolder just fine ootb and the config for subdomain is not so trivial.
You would need to use Nginx Server Blocks (Virtual Hosts) to have different configuration for different domains. Following gives an idea on how it could looks like How To Set Up Nginx Server Blocks (Virtual Hosts) on Ubuntu 16.04 | DigitalOcean
Thanks for the pointer @Joulinar
Not too confident knowing my abilities, but I will give it a try.
Ask my wife who asked me to make things consistent for every service hosted at home.
All good, nginx server blocks allowed me to do what I was told to want.
Pihole still accessible, nextcloud and others on a subdomain.
Another bump for this article. I would like to run various web sites/apps on DietPi using nginx, each of them being reachable under their own domain name. I want to tie each domain with their own web root, by using various virtual host/server block files. I don’t want to use the default set-up of subfolders under a single web root.
Reading the documentation and forum posts, it’s unclear to me how the scripts used with DietPi may interfere with such a virtual host set-up. So, once the virtual host to tie the webroot to that appropriate (sub)domain has been set up, will I run into issues during an update, a reinstall of the app, letsencrypt renewal, etc?