include drop.conf;

client_max_body_size 15M;
client_body_buffer_size 128k;
location / {
    try_files $uri $uri/ @dw;
}

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

location ~ \.php$ {
    include fastcgi_params;
    fastcgi_param HTTPS $php_https;#DW checks $_SERVER['HTTPS']
    fastcgi_pass unix:/tmp/php5-fpm.sock;
}

# Block access to data folders
location ~ /(data|conf|bin|inc)/ {
deny all;
}

# Block access to .htaccess files
location ~ /\.ht {
deny  all;
}
