Welcome! Log In Create A New Profile

Advanced

Problem with try_files: =404 results in php files being downloaded instead of parsed by php

June 24, 2012 06:24PM
Hello,

I tried changing my template configuration so that it would show "404 not found" instead of "No input file specified." but to my surprise, try_files did something completely unpredictable and now I'm stuck with "No input file specified.". To be exact I tried changin this:
> try_files "$uri" "$uri/" "/index.php";
into this:
> try_files "$uri" "$uri/" "/index.php" =404;
which then resulted in nginx sending the php file as application-octet-stream, instead of parsing it through the fastcgi handler. How do I do the above right, if not with the try_files syntax?

My configurations:
/etc/nginx/nginx.conf - http://files.realitybends.de/nginx.conf
/etc/nginx/mime.types - http://files.realitybends.de/mime.types
/etc/nginx/conf.d/default.conf - http://files.realitybends.de/conf.d/default.conf
/etc/nginx/conf.d/mime.types - http://files.realitybends.de/conf.d/mime.types
/etc/nginx/inc.d/global.conf - http://files.realitybends.de/inc.d/global.conf
/etc/nginx/inc.d/php.conf - http://files.realitybends.de/inc.d/php.conf
/etc/nginx/sites-available/realitybends.de - http://files.realitybends.de/sites-available/realitybends.de
The corresponding line is in /etc/nginx/inc.d/global.conf:
> Line 21: try_files "$uri" "$uri/" "/index.php";

Thanks in advance,
Xaymar
Subject Author Posted

Problem with try_files: =404 results in php files being downloaded instead of parsed by php

Xaymar June 24, 2012 06:24PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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