Welcome! Log In Create A New Profile

Advanced

error directive help with 404

May 28, 2010 06:23PM
Hi all,
I've just moved from an apache2 server and i'm trying to set up nginx.

Its installed, compiled from source and running fine.
In the process of fine tuning my setup i noticed my 404's aren't doing what i want.

I have my wordpress blog setup with php-fpm for php

when a 404 happens on a file with .html or /no-existent-url
the 404 does what i expect and wordpress handles it with my custom page.

if i enter domain.com/somepage.php i get the nasty default page that browsers server.
in I.E especially

my server config looks like this

server {
listen 80;
server_name www.domain.com;

try_files $uri $uri/ /index.php?q=$uri&$args;
#error_page 404 /index.php?error=404;
location / {
root /usr/share/nginx/html;
index index.html index.htm index.php;
if (!-e $request_filename) {
rewrite ^ /index.php last;
}
error_page 404 /swf/404.php;
location = /swf/404.php {
root /usr/share/nginx/html;
}


}
I've searched about and found examples of the error_page directive being used not specifically for a 404 but i assumed its the same.
It doesn't seem to work though.
Can anyone help me please?
Subject Author Posted

error directive help with 404

robinsonc494 May 28, 2010 06:23PM

Re: error directive help with 404

Maxim Dounin May 30, 2010 06:00PM

Re: error directive help with 404

robinsonc494 May 31, 2010 06:04PM



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