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."
Subject Author Posted

Which 404 file does nginx calls?

agriz October 20, 2013 12:02PM

Re: Which 404 file does nginx calls?

agriz October 20, 2013 03:11PM

Re: Which 404 file does nginx calls?

Francis Daly October 20, 2013 04:34PM

Re: Which 404 file does nginx calls?

agriz October 20, 2013 05:11PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 56
Record Number of Users: 7 on October 18, 2016
Record Number of Guests: 386 on August 02, 2016
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready