Please help me get FastCGI working with nginx

Igor Sysoev is at rambler-co.ru
Tue Aug 5 17:28:28 MSD 2008


On Mon, Aug 04, 2008 at 06:06:02PM -0700, Rt Ibmer wrote:

> > purposely request a PHP page that doesn't exist (as a
> > test) the browser returns "No input file
> > specified." instead of the standard 404 page?
> > 
> > You need
> >     fastcgi_intercept_errors  on;
> 
> Thanks. I did that, but then had to also use the error_page directive to point it at my 404.php page.
> 
> However this has the undesirable effect of then changing the URL in the browser to 404.php.
> 
> Is there a way I can have nginx return the content of my 404.php page as the output, so the user still sees their bad page in the URL (i.e. http://www.mysite.com/badpage.php instead of http://www.mysite.com/404.php)?

      location ~* \.php$ {

           fastcgi stuff

           fastcgi_intercept_errors  on;
           error_page   404  /404.php;
      }


-- 
Igor Sysoev
http://sysoev.ru/en/





More information about the nginx mailing list