Nginx sample configuration files for common use cases, like serving static files, proxying and talking to fastcgi or uswgi services.
Common use-case nginx configurations
Nginx is an event-driven webserver / reverse-proxy capable of handling many concurrent requests with relative ease.
This repo provides some boilerplate examples and recipe for getting started at configuring nginx for common use-cases, e.g. serving static files fast and efficient.
It is recommended to always use the latest stable version of nginx. At the time of this writing this is version 1.0.0.
The repository can be cloned with
git clone https://github.com/macedigital/nginx-recipe.git.
- Put ‘recipe’, ‘sites-available’ and ‘sites-enabled’ folders into nginx configuration directory
- Pick an example vhost config and replace
rootdirectives with appropiate values
- Symlink wanted vhost config in sites-enabled folder, make sure it ends with .conf
- If not already done so, update your main nginx configuration file ‘nginx.conf’ with
- Reload nginx
killproc /usr/sbin/nginx -HUP
Inspiration came from others having had similar ideas, most notably:
These recipe work for me and may not work for you. If you think you spotted an error or have suggestions for improvements just drop me a note.