location / {
index index.php index.html;
if (!-e $request_filename){
rewrite ^/list/(.+)\.html$ /theme/list.php?type=$1;
rewrite ^/book/(.+)_(.+)\.html$ /theme/book.php?uid=$1&id=$2;
rewrite ^/log/(.+)_(.+)\.html$ /theme/catalog.php?uid=$1&id=$2;
rewrite ^/read/(.+)_(.+)/(.+)\.html$ /theme/read.php?uid=$1&id=$2&pid=$3;
rewrite ^/(.+)\.html /theme/$1.php;
}
}