I learned how to get NGINX to return 503
customer error pages,
but I cannot 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 503.html
is found in my root directory, the site will return this page to the user.
But it seems that although the code above works when someone simply visits my site typing
it does not trap requests like:
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 503.html
whenever 503.html
is present in my root folder?