Drupal 创建自定义 500 服务器错误页面

问题描述 投票:0回答:1

我目前正在 Drupal 9 上创建自定义错误页面。

我知道我可以轻松地为 404 和 403 添加自定义页面,但是如何使用自定义页面来处理所有可能的错误,例如 401、403、500、502 等?

我找到了这个模块:https://www.drupal.org/project/error_page但我看不到结果,不太确定我搞砸了哪一部分。

drupal drupal-modules
1个回答
0
投票

如果使用 NGINX,请包括以下内容:

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;
    }

}

在配置文件的服务器部分。

© www.soinside.com 2019 - 2024. All rights reserved.