Welcome! Log In Create A New Profile

Advanced

Re: Which 404 file does nginx calls?

October 20, 2013 03:11PM
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."
SubjectAuthorPosted

Which 404 file does nginx calls?

agrizOctober 20, 2013 12:02PM

Re: Which 404 file does nginx calls?

agrizOctober 20, 2013 03:11PM

Re: Which 404 file does nginx calls?

Francis DalyOctober 20, 2013 04:34PM

Re: Which 404 file does nginx calls?

agrizOctober 20, 2013 05:11PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 62
Record Number of Users: 7 on March 06, 2014
Record Number of Guests: 156 on March 20, 2014
Powered by nginx    Powered by FreeBSD    PHP Powered    Powered by Percona     ipv6 ready