Drupal create custom 500 server error page

106 Views Asked by At

I'm currently working on creating custom error pages on Drupal 9.

I know I can easily add customized pages for 404 and 403, but how can I use custom pages for all possible errors like 401, 403, 500, 502, and etc.?

I found this module: https://www.drupal.org/project/error_page but I couldn't see the result, not so sure which part I messed up with.

1

There are 1 best solutions below

0
Balde Binos On

If using NGINX include someting like:

server {

    error_page                500 501 502 503 504 505 506 507 508 510 511
                              @error_5xx;

    location @error_5xx {
        rewrite ^/(.*)$ https://$server_name/error_5xx.html;
    }

}

in the server section of your configuration file.