Welcome! Log In Create A New Profile

Advanced

Nginx rewrite to PHP

B.R.
April 21, 2012 10:14PM
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;
}

location ~ \.php$ {
// PHP handling there
}

What am I doing wrong?
---
*B. R.*
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Nginx rewrite to PHP

B.R. April 21, 2012 10:14PM

Re: Nginx rewrite to PHP

Edho Arief April 21, 2012 10:20PM

Re: Nginx rewrite to PHP

B.R. April 21, 2012 10:24PM

Re: Nginx rewrite to PHP

Edho Arief April 21, 2012 10:34PM

Re: Nginx rewrite to PHP

B.R. April 21, 2012 10:40PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 265
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