nginx.conf @ 2ddd7cacb25e

Typo.
author Steve Losh <steve@stevelosh.com>
date Tue, 06 Sep 2011 12:25:48 -0400
parents b39558243b24
children e7bc59b9ebda
server {
    listen   80;
    server_name  www.stevelosh.com;
    rewrite ^/(.*) http://stevelosh.com/$1 permanent;
}
server {
    listen   80;
    server_name  stevelosh.com;

    access_log /tmp/stevelosh.com.access.log;
    error_log /tmp/stevelosh.com.error.log;

    location / {
        root   /var/www/stevelosh.com/;
        index  index.html;

        if ($request_uri ~ ^/blog/entry/\d+/\d/\d+/[^/]*/?$) {
            rewrite ^/blog/entry/(\d+)/(\d)/\d+/([^/]*)/?$ /blog/$1/0$2/$3/ permanent;
            break;
        }

        if ($request_uri ~ ^/blog/entry/\d+/\d\d/\d+/[^/]*/?$) {
            rewrite ^/blog/entry/(\d+)/(\d\d)/\d+/([^/]*)/?$ /blog/$1/$2/$3/ permanent;
            break;
        }

        if ($request_filename ~ ^.*.html$) {
            rewrite ^(.*).html$ $1/ permanent;
            break;
        }

        if (-f $request_filename) {
            break;
        }

        if ($request_uri ~ ^.+[^/]$) {
            rewrite ^/(.*)$ /$1/ permanent;
            break;
        }

        if (-f $request_filename/index.html) {
            rewrite ^(.*)/$ /$1/index.html;
            break;
        }

        if ($request_filename ~ ^.*/$) {
            rewrite ^/(.*)/$ /$1;
        }

        if (-f $request_filename.html) {
            rewrite ^/(.*)$ /$1.html;
            break;
        }
    }
}