New to nginx need help
July 20, 2015 11:04AM
Hello everyone,
I want to make it so whenever someone tries to access a page that doesn't exist, he gets redirected to lets say 404.php
I could get it done for the following examples:
http://l2ovc.com/bla
http://l2ovc.com/bla.html

but cannot get it done for:
http://l2ovc.com/bla.php

I get a blank page with "File not Found" text.
Here is my server configuration:

server {
listen 80;
server_name l2ovc.com;
root /usr/share/nginx/html;
location / {
index index.php;
}
error_page 404 /404.php;
error_page 500 502 503 504 /50x.html;
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html$fastcgi_script_name;
include fastcgi_params;
}
}

What changes should I make to it to make it work?
Re: New to nginx need help
July 20, 2015 02:51PM
Managed to solve the issue.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 152
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready