Quantcast
Channel: Nginx Forum
Viewing all articles
Browse latest Browse all 53287

Re: Apache rewriterule to nginx rewriterule

$
0
0
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

Viewing all articles
Browse latest Browse all 53287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>