diff --git a/plugins/nginx-vhosts/templates/502-error.html b/plugins/nginx-vhosts/templates/502-error.html
new file mode 100644
index 000000000..0390baaa8
--- /dev/null
+++ b/plugins/nginx-vhosts/templates/502-error.html
@@ -0,0 +1,64 @@
+
+
+
+ We're sorry, but something went wrong (500)
+
+
+
+
+
+
+
+
+
We're sorry, but something went wrong.
+
If you are the application owner check the logs for more information.
+
+
+
diff --git a/plugins/nginx-vhosts/templates/nginx.conf.sigil b/plugins/nginx-vhosts/templates/nginx.conf.sigil
index 360ba4a6a..e67ba75e3 100644
--- a/plugins/nginx-vhosts/templates/nginx.conf.sigil
+++ b/plugins/nginx-vhosts/templates/nginx.conf.sigil
@@ -105,11 +105,17 @@ server {
internal;
}
- error_page 500 501 502 503 504 505 506 507 508 509 510 511 /500-error.html;
+ error_page 500 501 503 504 505 506 507 508 509 510 511 /500-error.html;
location /500-error.html {
root {{ $.DOKKU_LIB_ROOT }}/data/nginx-vhosts/dokku-errors;
internal;
}
+
+ error_page 502 /502-error.html;
+ location /502-error.html {
+ root {{ $.DOKKU_LIB_ROOT }}/data/nginx-vhosts/dokku-errors;
+ internal;
+ }
}
{{ end }}{{ end }}