Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

New to nginx need help

$
0
0
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?

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>