nginx

Engine X

location modifier pattern {
	…
}

Modifiers:

  • (none) — prefix match
  • = — exact match
  • ~ — case-sensitive regex
  • ~* — case-insensitive regex
  • ^~ — non-regex
client_max_body_size 25M;
add_header x-header "value";

Logging

log_format minimal '[$time_local] $status "$request" $body_bytes_sent bytes'
access_log path minimal;
error_log path severity;

Default severity: error

Clean URLs

try_files $uri $uri.html $uri/index.html =404;

rewrite ^/index(?:\.html|/)?$ / permanent;
rewrite ^/(.*)/index(?:\.html|/)?$ /$1 permanent;
rewrite ^/(.*)(?:\.html|/)$ /$1 permanent;

URLs Without Trailing Slash or Extension