5 ms·
I think the sites-available is a debianism, not present on all distros. One nice thing that nginx supports is include directives with wildcards so you can e.g.
by thu 13y ago
I think the sites-available is a debianism, not present on all distros. One nice thing that nginx supports is include directives with wildcards so you can e.g. have /srv/example.com/nginx.conf and /srv/api.example.com/nginx.conf and include them in the main configuration file with include /srv/*/nginx.conf.
- ChikkaChiChi 13y agoI may be misunderstanding you, but sites-available and the conf files are usually two separate entities. sites-available | sites-enabled is analogous to using a2ensite in Apache without the automagic (you symlink yourself)
- callmeed 13y agoYeah, I run nginx on both Ubuntu and RedHat boxes. On RedHat, the conf files go in /opt/nginx/conf ... there is no sites-avail/enabled
- lowboy 13y agoI ran into a version of Nginx on CentOS had sites-avail/enabled.
- ciclista 13y agoI'm currently running Centos 6 on my VPS and it has this file structure.
- jlogsdon 13y agoHe did mention specifically that the structure was provided by the `apt` install.
- merlincorey 13y agoToday You Learn that is because the original package maintainer of the NginX package in Debian (and thus later, Ubuntu) simply copied the structure of the Apache package. It's most useless because there is no script to manage the sites available like with apache. I have been complaining about this for years! On FreeBSD and all my client's sites (whether they run Linux or what), I always set mine to include sites/*.conf and delete those apache-isms.
- vacri 13y agoIt's especially bizarre given how trivial such a script is - as far as I am aware, it's a glorified symlink-maker. Hrm, looking now, a2ensite is 340 lines long...
- merlincorey 13y agoQuite the glorified symlink maker! It is my experience from years of administration that `ln` and `rm` (or perhaps `mv`) are the only commands necessary to work with the directories without the scripts.
- 616c 13y agoYou know how many times I had to restart the nginx daemon on a VPS for me to figure this out. Thank you for complaining!
- Livven 13y agoThere are "official" nginx packages for Ubuntu and other major Linux distributions which are always up-to-date and use a standard conf.d directory for including configuration files http://nginx.org/en/linux_packages.html http://nginx.org/en/linux_packages.html