Understanding of "add domain" and NGINX folder structure

Friends,

can you explain what’s happens when i ADD a domain in yunohost,

in my understanding it just create a NGINX configuration file to listen to desired URL
anything else ?

in case of manual installation on a SITE in NGINX the advised steps are

  1. i create SITE.conf inside /etc/nginx/sites-available/

  2. then to activate site

sudo ln -s /etc/nginx/sites-available/test.com /etc/nginx/sites-enabled/

  1. test and restart

sudo nginx -t
sudo systemctl restart nginx


So what is beyond my understanding is at m VPS i was adding all domains via yunohost, and the results are not following the logic above … “sites-available/” and “sites-enabled/” is empty

root@vps:# ls -all /etc/nginx/sites-available/
total 12
drwxr-xr-x 2 root root 4096 Dec 6 03:08 .
drwxr-xr-x 7 root root 4096 Dec 6 03:08 …
-rw-r–r-- 1 root root 1874 Oct 27 2016 default

root@vps:~# ls -all /etc/nginx/sites-enabled/
total 8
drwxr-xr-x 2 root root 4096 Apr 23 2017 .
drwxr-xr-x 7 root root 4096 Dec 6 03:08 …

and all my sites are here

root@vps:# ls -all /etc/nginx/conf.d/
blocked-sites.conf
SITE.net.d/
SITE.net.conf

why it is like this ?

It does many other things that simply adding nginx configuration. It prepares a self-signed certificate, add a few stuff in LDAP, and add configurations for the XMPP and mail stack as well. (c.f. here for a starter on the full details)

The nginx conf indeed does not follow the sites-available / sites-enabled scheme. I don’t know the reason for this, but naively I would ask “why should yunohost follow it” ?

1 Like

i guess it is simplier for YUNOHOST INSTALL scripts to add just only one file from conf.d folder
rather then adding it to available and making and ln

same for delete