Nginx boilerplate: Quick and elegant setting nginx

Nginx boilerplate: Quick and elegant setting nginx

Nginx boilerplate: Quick and elegant setting nginx

I would like to share their experience on setting up nginx, which may
help someone when you start a new project or get rid of the need to
kopipastit another vhost.

I noted two problems with the overwhelming number of nginx config, catches my eye:
“All in one file”
Duplicate settings

With my approach, I hope these and many other issues will be addressed.

Before you collect all the achievements in a separate project I was looking for something
like that, but nothing worthwhile was not found.

The project called himself ┬źNginx boilerplate┬╗. And, similar to the HTML5 Boilerplate ,
it serves for a quick start when setting up a new virtual host.

In fact it is a set of config files, which provides:
Logical branched structure of configuration files nginx
Optimization of the default settings
Templates to limit the frequency of requests and the number of connections
Caching backend response to the Web server
A number of pre-defined locations are for various tasks and requirements
Improved logging


For example - as currently seems default server:

server { listen 80 default_server; server_name ""; root /var/www/nginx-bp/test/www/; include nginx-bp/cache.conf; include nginx-bp/limits/methods.conf; include nginx-bp/locations/php.conf; include nginx-bp/locations/favicon.conf; include nginx-bp/locations/static.conf; include nginx-bp/locations/system.conf; location / { include nginx-bp/logs/bots.conf; } }


If you have a cool recipe for nginx - join us!

Article Source: Here

http://habrahabr.ru/post/185788/