cryptofuture / nginx-hda-bundle

Nginx HDA Bundle - Dynamic Modules Power
https://launchpad.net/~hda-me/+archive/ubuntu/nginx-stable
81 stars 11 forks source link

General request: make this packaging compatible with the official nginx one #20

Closed Synchro closed 6 years ago

Synchro commented 6 years ago

This is a great bundle, but it has a number of differences from the official nginx packages that are obstacles for anyone switching from them, for example the nginx.conf file is unnecessarily different: it lacks an include directive to load additional config from /etc/nginx/conf.d, and setting worker_processes 1; is really unhelpful. My recommendation would be to keep the config identical as far as possible, and only change what is strictly necessary to add what your packaging provides, which should be only the loadmodule directives. They could be put in an external file (instead of directly in nginx.conf) and perhaps load from the conf.d folder. This would allow seamless switching from the stock packages and back without needing to change stock config files significantly. I'm a big fan of conf.d folders because they allow you to use distro defaults for standard config files and override them with external files, so package updates can overwrite standard config files safely.

cryptofuture commented 6 years ago

Well default nginx config still use koi8-r and sucks. So I'm against that. Beside most thing commented anyway. Configs loaded from sites-enabled like truly Debian way. worker_processes 1; is ok when you run in container with one core, and anyway would be tweaked in real scenario by the user. And vps with one core are actually the most common one, and most cheapest, so I guess beginner could benefit from it. /etc/nginx/conf.d usually used for default config, that tell that nginx is running and only confuse beginners, and they usually do 444 or 404 to cover real server ip, instead of disabling default config. Anyway, you could always change the config the way you like and use, I don't think this is a real problem with tools like salt, ansible and other available in the wild. Also config shouldn't be overwritten, but saved in *.dpkg-dist file if you have one, so you should avoid problem with old config file.

Synchro commented 6 years ago

Well the Debian way is to load from conf.d. If a package update updates a config file you have altered, apt-get and friends will prompt you to choose whether to overwrite, replace, show a diff etc - and that is very confusing for beginners, and completely avoidable if you use conf.d. A more sensible default for worker_processes is auto. My point is that the changes you've made to the default config are mostly arbitrary and opinionated, and make it unnecessarily difficult to switch to and from your package. The reason I opened this ticket is that I use ansible, and I had to completely rearrange my config to work with your package. That shouldn't be necessary when the primary focus of your package is to add dynamic modules, not to change the entire config system for nginx for no particular reason - not least because it means that you have to do more work to maintain it.

cryptofuture commented 6 years ago

auto is reasonable. But conf.d is just the another path, while we have and happy with single sites-enabled