nginx

Modules
# List modules
nginx -V

Sites
# /etc/nginx/sites-available/www.example.com.conf
server {
server_name www.example.com;
listen 443 ssl;

root /usr/share/nginx/www/;

ssl_certificate /etc/ssl/certs/ssl-cert-snakeoil.pem;
ssl_certificate_key /etc/ssl/private/ssl-cert-snakeoil.key;

sub_filter_once off;
sub_filter "Welcome" "Sello";
}

server {
server_name www.example.com;
listen 80;

root /usr/share/nginx/www/;

access_log /var/log/nginx/access_www.example.com.log;
error_log /var/log/nginx/error_www.example.com.log debug;

sub_filter_once off;
sub_filter "Welcome" "Hello";
}

Options
# allow body size / upload up to 10 MB
client_max_body_size 10M;

Snippets
location /foo {
if ( $request_method != 'POST' ) {
return 400;
}
}

# disable cache
location stuffyoudontwanttocache {
proxy_no_cache 1; # don't cache it
proxy_cache_bypass 1; # even if cached, don't try to use it
}
# expires 1s;

# redirect to https
if ($ssl_protocol = "") {
return 301 https://$server_name$request_uri;
}

# directory listing / autoindex
https://www.keycdn.com/support/nginx-directory-index/
location /foo/ {
autoindex on;
}

https://www.nginx.com/resources/wiki/modules/fancy_index/
https://github.com/aperezdc/ngx-fancyindex
apt-get install -y nginx-extras
cat /etc/nginx/sites-enabled/default
...
location /foo/ {
fancyindex on;
fancyindex_exact_size off;
}

Links
http://wiki.nginx.org/Configuration
http://wiki.nginx.org/HttpSubsModule
http://wiki.nginx.org/NginxHttpSubsModule
https://www.nginx.com/resources/admin-guide/restricting-access/
http://openresty.org/en/