NGINX Custom Error page for 504 timeout not working

Solution 1:

Your error_page files need to be located under /usr/share/nginx/html/errors directory, because nginx appends the path after location to the path specified in root directive.