From 3b78e65b2b0bfde09b05d1aa25750d81d46ca252 Mon Sep 17 00:00:00 2001 From: Chiedo Date: Mon, 6 Mar 2017 13:46:46 -0500 Subject: [PATCH] Added better default nginx error pages --- .../nginx-vhosts/templates/nginx.conf.sigil | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/plugins/nginx-vhosts/templates/nginx.conf.sigil b/plugins/nginx-vhosts/templates/nginx.conf.sigil index 6638afe37..903f4f58d 100644 --- a/plugins/nginx-vhosts/templates/nginx.conf.sigil +++ b/plugins/nginx-vhosts/templates/nginx.conf.sigil @@ -34,6 +34,20 @@ server { proxy_set_header X-Request-Start $msec; } include {{ $.DOKKU_ROOT }}/{{ $.APP }}/nginx.conf.d/*.conf; + + error_page 400 401 402 403 405 406 407 408 409 410 411 412 413 414 415 416 417 418 420 422 423 424 426 428 429 431 444 449 450 451 /400-error.html; + location /400-error.html { + return 400 '

THERE HAS BEEN AN ERROR.

'; + + error_page 404 /404-error.html; + location /404-error.html { + return 404 '

404. Page Not Found.

'; + } + + error_page 500 501 502 503 504 505 506 507 508 509 510 511 /500-error.html; + location /500-error.html { + return 500 '

THERE HAS BEEN AN ERROR.

'; + } {{ end }} } {{ else if eq $scheme "https"}} @@ -72,6 +86,22 @@ server { proxy_set_header X-Request-Start $msec; } include {{ $.DOKKU_ROOT }}/{{ $.APP }}/nginx.conf.d/*.conf; + + + error_page 400 401 402 403 405 406 407 408 409 410 411 412 413 414 415 416 417 418 420 422 423 424 426 428 429 431 444 449 450 451 /400-error.html; + location /400-error.html { + return 400 '

THERE HAS BEEN AN ERROR.

'; + + error_page 404 /404-error.html; + location /404-error.html { + return 404 '

404. Page Not Found.

'; + } + + error_page 500 501 502 503 504 505 506 507 508 509 510 511 /500-error.html; + location /500-error.html { + return 500 '

THERE HAS BEEN AN ERROR.

'; + } + } {{ end }}{{ end }}