Hi all – I'm extremely new to Nginx and playing around with some things in a homelab.
Currently, I have a registered domain name and set up port forwarding to my nginx proxy server for reverse proxying. I'm able to hit the root domain + www.rootdomain URLs without a problem.
I also self-host Gitlab-CE on a separate server (it's actually a RasPi) and I'd like to add gitlab.domain.com to the nginx proxy with SSL via Letsencrypt.
Here's the question: is it best practice to put all server blocks in the same sites-available file? I suspect if I try to break them into separate files, I'll get a conflict because both will be listening on the same port.
How do you all handle subdomain entries? Do you keep in a single config file for the same domain or do you break subdomain configs out into a different file?
Thanks – appreciate any guidance here before I really screw this up. haha
Source: r/nginx · by /u/jimmyfivetimes