Welcome! Log In Create A New Profile

Advanced

url rewriting problem with location ~* ^.+.(jpg|jpeg|gif|...

Posted by htcfan64 
url rewriting problem with location ~* ^.+.(jpg|jpeg|gif|...
March 10, 2012 08:06PM
Hello, nginx is awesome!!! but i ve a problem with my nginx conf :

rewrite ^/video/(.*)/(.*) /playvideo.php?videoid=$1&title=$2 last;
location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|srt|txt|swf)$ {access_log off;expires 30d;}

every url that s finishing with jpg,jpeg,ico... have a 404 error i mean
ive this url rewriting: http://www.sitename.com/video/hello-cat-mexico this url have error 404 because it s ended with "ico" its the same with
http://www.sitename.com/video/hello-cat-mexijs (finish with js)
http://www.sitename.com/video/my-file-css (finish with css)...
But its ok if i remove location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|srt|txt|swf)$ {access_log off;expires 30d;}

So what can i do, its pretty strange?
Tx for your help.
Re: url rewriting problem with location ~* ^.+.(jpg|jpeg|gif|...
May 22, 2013 02:26AM
You're missing a backslash.
So it will look like this:

location ~* ^.+\.(jpg|jpeg|gif|css|png|js|ico|srt|txt|swf)$ {access_log off;expires 30d;}
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 206
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready