Hello experts,
Although I have found of lot of info on how to get NGINX to return 503 customer error pages I have not been able to find out how to do the following:
Sample config file:
location / {
root www;
index index.php;
try_files /503.html = 503;
}
error_page 503 /503.html;
location = /503.html {
root www;
}
As you can see, according to the code above, if a page called error503.html is found in my root directory, the site will return this very page to the user.
The issue:
It seems that although the code above works when someone simply visits my site typing http://www.mysite.com, it DOES NOT TRAP a request like http://www.mysite.com/profile.php. With my code, the user can still see the profile page or any other pages besides index.php.
The question:
How do I trap requests to all pages in my site and forward them to error503.html whenever error503.html is present in my root folder?
Thank you for any help.