can some1 please convert this htaccess to nginx rewrite?

Igor Sysoev is at
Thu Jan 15 23:06:06 MSK 2009

On Thu, Jan 15, 2009 at 08:53:55PM +0100, Lemon Head wrote:

> i got a signup verification script for my forum that shows images
> and asks the user to match it with the provided word
> it worked fine when i was using apache but today after
> i made the switch to nginx the images dont load anymore
> this script have an .htaccess file that contains:
> RewriteEngine on
> RewriteRule (.*) /show.php
> can someone please convert it to nginx rewrite?
> also i'm not sure if it matters but the full path
> to the .php file is /usr/share/nginx/html/forum
> another small problem i have is that if i get into
> http://mysite/forum it doesnt load the page,but if i add
> a secondary slash however as in /forum/ it works fine
> how can i fix it? thanks in advance

Something like this:

     location /forum {
         fastcgi_pass  ...;
         fastcgi_param  SCRIPT_FILENAME  /usr/share/nginx/html/forum/show.php;
         include        fastcgi_params;

Igor Sysoev

More information about the nginx mailing list