Maybe too late, but it's best to avoid rewrites at all. Use location captures, instead:
location ~ ^/blog/(?<id>.*)/$ {
include fastcgi_params;
fasctgi_param SCRIPT_FILENAME $document_root/blog_view.php;
fastcgi_param QUERY_STRING id=$id&$args;
fastcgi_pass ...; # path to your php-fpm socket
}
location ~ ^/blog/category/(?<id>.*)/$ {
include fastcgi_params;
fasctgi_param SCRIPT_FILENAME $document_root/blog_category.php;
fastcgi_param QUERY_STRING id=$id&$args;
fastcgi_pass ...; # path to your php-fpm socket
}
Andrejs
loco (at) andrews.lv
Edited 1 time(s). Last edit at 05/07/2013 07:56AM by locojohn.