mod rewrite - Converting Apache RewiteRule to Nginx's -


i installed nginx , running serving static content on site. works great apache rewrite rule images (ofcourse) stoped working.

and don't have idea how convert , in whcih file put .

this using on apache :

rewritecond %{http_referer} !^http://(www\.)?imgzzz.com/.*$ [nc] rewriterule i/image_(\d+)\.(jpg|jpeg|gif) pic/$1 [l] 

its purpose redirect directly accessed images image page instead.

thanks in advance :) cheers

k found answer myself on doing research. leaving here in case else needs

location /i/image_ {  location ~ ^/i/image_(?<image>\d+)\.(jpg|jpeg|gif)$ { valid_referers imgzzz.com www.imgzzz.com;  if ($invalid_referer) { rewrite ^ /pic/$image; } } } 

Comments

Popular posts from this blog

Add email recipient to all new Trac tickets -

400 Bad Request on Apache/PHP AddHandler wrapper -

php - Change action and image src url's with jQuery -