📜 ⬆️ ⬇️

Nginx boilerplate: Quick and elegant nginx setup

I want to share my work on setting up nginx, which may help someone at the start of a new project or eliminate the need to copy the next vhost.

I noted two problems of the overwhelming number of nginx configs that caught my eye:

With the help of my approach, I hope these and many other problems will be eliminated.

Before collecting all the developments in a separate project, I was looking for something similar, but nothing worthwhile was found.

The project was called "Nginx boilerplate" . And, by analogy with HTML5 Boilerplate , it serves as a quick start when setting up a new virtual host.
')
In essence, this is a set of configs that provides:


For example, the default server looks like this at the moment:

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 some cool recipes for nginx - join us!

References:

Source: https://habr.com/ru/post/185788/


All Articles