Nginx rewrite to PHP

B.R. reallfqq-nginx at yahoo.fr
Sun Apr 22 02:23:00 UTC 2012


Thanks Edho,

I also use the official reference first-hand ;o)
>From the example given on the Wiki page of the Rewrite module you
quoted<http://wiki.nginx.org/HttpRewriteModule>,
they replace 'last' by 'break' when rewrite rules put inside a location
block...

Isn't it a problem to put 'last' flags inside the location block? What is
the 10-cycles-then-500-error referring to?
---
*B. R.*


On Sat, Apr 21, 2012 at 22:17, Edho Arief <edho at myconan.net> wrote:

> 2012/4/22 B.R. <reallfqq-nginx at yahoo.fr>:
> > Hi,
> >
> > I'm using Nginx linked to PHP using fastcgi proxy (to the FPM module of
> PHP
> > core btw).
> >
> > I am trying to use some rewrite rules, which apparently work since I get
> > redirected (HTTP answer 200), but the content is not passed through the
> PHP
> > handler...
> > I am returned the file for downloading which content is the raw PHP code!
> >
> > I am using a configuration like the following:
> >
> > location / {
> >  rewrite ^/dunno/([^\.^/]+)$ /index.php?q=$1 break;
> >  return 404;
> > }
> >
>
> break means the file is handled by current location block (location /
> { }). The one
> you want is last.
>
> reference: http://nginx.org/r/rewrite
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20120421/2b9816e7/attachment.html>


More information about the nginx mailing list