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 also use the official reference first-hand ;o)
From the example given on the Wiki page of the Rewrite module you
quotedhttp://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?
I also use the official reference first-hand ;o)
From the example given on the Wiki page of the Rewrite module you quoted,
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?
The 500 error is cause by the rewrite: it rewrites /download/ (clean
url) to /download/ (actual file). If it use last flag, the /download/
location block will be searched again (and in fact it may return 403
instead of 500 if the rewritten url doesn’t match the rewrite rule
anymore - it’ll return 500 only on certain cases).
The one you want is for it to be handled by different location block
(.php$) - hence last flag.