This is a collection of bits of Nginx configuration that I find myself using repeatedly, from deploying Flask webapps to PHP (eww) and SSL. There's also the boilerplate stuff there, so while the title says 'snippets', there is actually a full Nginx configuration in there.
More specifically, the repository contains:
- An init script (Debian) / an Upstart job (Ubuntu) that creates directories in
/runfor Python apps' web sockets - so that the applications needn't be started as root to create sockets in there.
- logrotate & syslog setup of
/var/log/wsgi-apps.log(easy logging from Python/WSGI apps).
- A Flask app shell ready for use with the Nginx uWSGI snippet & the above mentioned socket and logging layout, along with SMTP logging set up for exceptions.
- PHP5-FPM config, the Nginx config to go with it, and a separate snippet for Wordpress URL rewriting in Nginx (unfortunately lacking super/total caching support at the moment).
- Hopefully sane (and maybe even good!) core Nginx configuration.
- Various vhost shells: SSL, catch all (... requests to unknown domains), the main vhost (including dealing with a browser that doesn't send a Host header).