измените ваши nginx конфиги на
server {
listen 80 default_server;
server_name localhost;
root /usr/share/nginx/html/dist/app;
index index.html index.htm;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
ssi on;
root /usr/share/nginx/html/;
index 50x.html
internal;
}
location / {
try_files $uri $uri/ /index.html =500;
}
}
, и вы сможете увидеть пользовательскую ошибку
➜ ~ curl http://127.0.0.1:32769/
<!DOCTYPE html>
<html>
<head>
<title>Error</title>
<style>
body {
width: 35em;
margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif;
}
</style>
</head>
<body>
<h1>This is My custome error.</h1>
</body>
</html>
, в основном вам нужно добавить индекс к месту ошибки
index 50x.html
и выдает ошибку, если ни один из файлов не существует
try_files $uri $uri/ /index.html =500;