Url prettifying

Remco Bloemen

2014-05-07

Amazon EC2

NGinX

Redirect to 2π.com

TLS

https://www.startssl.com/?app=1

Choose 4096 bit RSA and SHA2.

Simplify urls

server {
    server_name www.example.com example.com;
    rewrite ^ https://example.com$request_uri? permanent;
}

# Rewrite years to two digits
rewrite ^/20([0-9][0-9])/(.*)$ /$1/$2 permanent;

## Remove /index
rewrite ^/index(.html?)?$ / permanent;
rewrite ^/(.*)/index(.html?)?$ /$1 permanent;

## Remove trailing slash
rewrite ^/(.*)/$ /$1 permanent;

## Remove file extensions
rewrite ^/(.*).html?$ /$1 permanent;

Site optimization

NGinx optimization

Client caching

gzip_proxied expired no-cache no-store private auth;

Statically GZipped files

http://nginx.org/en/docs/http/ngx_http_gzip_static_module.html http://nginx.org/en/docs/http/ngx_http_gunzip_module.html

gzip_static  always;
gunzip on;

SPDY