Welcome! Log In Create A New Profile

Advanced

Error page for bad folder request

Posted by battles 
Error page for bad folder request
March 20, 2016 08:19PM
error_page 404 /404.html;

location = /404.html {
root /var/www/;
}

I use the above to catch and direct 404s to a custom 404.html page in /var/www. All my other pages are located in another place. This works fine for catching invalid file request (www.me.net/path1/invalid_file.txt), but doesn't work properly for invalid folder request (www.me.net/invalid_path/). The problem is that I have an image in the custom 404 page and it doesn't show up when erroring on an invalid folder. I guess what I am asking is how do you process bad folder request?

Thanks.



Edited 3 time(s). Last edit at 03/20/2016 08:26PM by battles.
Re: Error page for bad folder request
March 21, 2016 03:21AM
http://nginx.org/en/docs/http/ngx_http_core_module.html#try_files

---
nginx for Windows http://nginx-win.ecsds.eu/
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 175
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