Hacker News new | past | comments | ask | show | jobs | submit login

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.



Today 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.


It'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...


Quite 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.


You know how many times I had to restart the nginx daemon on a VPS for me to figure this out. Thank you for complaining!


There 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


I 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)


On systems that have both, yes, they're separate. But that separation is something the distribution does to help you organize your rules — to nginx, they're all the same AFAIK.


It's distro-specific and it doesn't present by default in stock nginx.


Yeah, 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


He did mention specifically that the structure was provided by the `apt` install.


I ran into a version of Nginx on CentOS had sites-avail/enabled.


I'm currently running Centos 6 on my VPS and it has this file structure.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: