0
webserverがオフラインのときにカスタム502のエラーページを表示しようとしていますが、動作しません:デフォルトの502エラーページを表示し続けます上流はオフラインです)。Nginxはカスタム502のエラーページを使用しません
- 静的ファイル
/var/web/example.org/www/res
(例:/var/web/example.org/www/res/robots.txt
)の下にある:私のファイル構成は以下の通りです。
- エラーページは
/var/web/example.org/www
(例:/var/web/example.org/www/502.html
)未満です。これは、私が404と他のものを含むウェブサーバから来ていないエラーページがそのウェブサーバがオンのときにアクセス可能であることを望まないからです。ここで
は私の(匿名)設定されています
error_page 502 /502.html;
location /502.html {
root /var/web/example.org/www;
internal;
}
:私も(最後に、サーバブロックで)502をキャッチするために、以下の定義するには、次の
upstream exampleorg {
server 127.0.0.1:8087;
}
server {
listen 80;
server_name www.example.org;
# content
# - static
root /var/web/example.org/www/res;
# - main webserver
error_page 403 404 @exampleorg;
error_page 502 /../502.html;
location @exampleorg {
proxy_pass http://exampleorg;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
試してみました
しかし、nginxはデフォルトの502ページ(internal;
がなくても)を表示し続けました。どうすればいいですか?事前にお使いのソリューションに感謝:)