read
server {
listen   80;
    server_name  mywiki.com;

    access_log  /var/log/nginx/wiki.access.log;
    error_log   /var/log/nginx/wiki.error.log;

    #maximum file upload size is 4MB - change accordingly if needed
    client_max_body_size 4M;
    client_body_buffer_size 128k;

    rewrite ^(/)_media/(.*) $1lib/exe/fetch.php?media=$2 last;
    rewrite ^(/)_detail/(.*) $1lib/exe/detail.php?media=$2 last;
    rewrite ^(/)_export/([^/]+)/(.*) $1doku.php?do=export_$2&id=$3 last;

    location / {
        root /var/www/wiki;
        index  index.html index.htm index.php;
        if (!-f $request_filename) {
            rewrite ^(/)(.*)?(.*)  $1doku.php?id=$2&$3 last;
            rewrite ^(/)$ $1doku.php last;
        }
    }

    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /var/www/wiki;
    }

    location ~ \.php$ {
    root /var/www/wiki;
    fastcgi_pass   unix:/tmp/.fastcgi.www-data/socket;
        fastcgi_index  doku.php;
    fastcgi_intercept_errors        on;
    fastcgi_connect_timeout 30;
    include        /etc/nginx/fastcgi_params;
    fastcgi_param  SCRIPT_FILENAME  /var/www/wiki/$fastcgi_script_name;
    fastcgi_param  QUERY_STRING     $query_string;
    }
}
Back to Overview