Which 404 file does nginx calls?

Somewhere something happened.
I am not able to fix it.

error_page 404 404.html
During the test, i had this line in the site.conf file.

404.html had “File not found.”

Later i created a proper error page and changed the commands like this.

error_page 404 404.php
But nginx is still throwing “File not found.” but i have already deleted
that 404.html file from server

When i check for error log, I am getting “FastCGI sent in stderr:
“Primary
script unknown” while reading response header from upstream”

How do i fix it?

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,243869,243869#msg-243869

server_name .site.com;

root /var/www/site.com;
error_page 404 /404.php;
access_log /var/log/nginx/site.access.log;
index index.html index.php;

if ($http_host != “www.site.com”) {
rewrite ^ http://www.site.com$request_uri permanent;
}

    location ~* \.php$ {

try_files $uri = 404;

        fastcgi_index   index.php;
        fastcgi_pass    127.0.0.1:xxxx;
         fastcgi_buffer_size 128k;
         fastcgi_buffers 256 4k;
         fastcgi_busy_buffers_size 256k;
         fastcgi_temp_file_write_size 256k;
         fastcgi_read_timeout 240;

        include         /etc/nginx/fastcgi_params;
        fastcgi_param   SCRIPT_FILENAME

$document_root$fastcgi_script_name;

fastcgi_param SCRIPT_NAME $fastcgi_script_name;

    }

after adding error_page 404 /404.php

it works for other files which are not php. It calls the error page.
But if it is a php file, it shows “File not found.”

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,243869,243870#msg-243870

On Sun, Oct 20, 2013 at 03:11:04PM -0400, agriz wrote:

after adding error_page 404 /404.php

it works for other files which are not php. It calls the error page.
But if it is a php file, it shows “File not found.”

http://nginx.org/r/fastcgi_intercept_errors

f

Francis D. [email protected]

Thanks a ton for you!

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,243869,243875#msg-243875

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs