Requested improvements

- Moved the template files
- Replaced . with $PWD
- Made more descriptive errors in the templates
This commit is contained in:
Chiedo
2017-03-07 14:28:38 -05:00
parent fa286caca2
commit 3f4b1e69c7
5 changed files with 13 additions and 13 deletions

View File

@@ -53,10 +53,10 @@ gpasswd -M "" dokku
[[ -f /etc/logrotate.d/nginx ]] && sed -i -e 's/create 0640 www-data dokku/create 0640 www-data adm/g' /etc/logrotate.d/nginx
# Create nginx error templates
sudo mkdir -p /etc/nginx/dokku-errors
sudo cp ./templates/400-error.html /etc/nginx/dokku-errors/400-error.html
sudo cp ./templates/404-error.html /etc/nginx/dokku-errors/404-error.html
sudo cp ./templates/500-error.html /etc/nginx/dokku-errors/500-error.html
sudo mkdir -p $DOKKU_LIB_ROOT/data/nginx-vhosts/dokku-errors
sudo cp $PWD/templates/400-error.html $DOKKU_LIB_ROOT/data/nginx-vhosts/dokku-errors/400-error.html
sudo cp $PWD/templates/404-error.html $DOKKU_LIB_ROOT/data/nginx-vhosts/dokku-errors/404-error.html
sudo cp $PWD/templates/500-error.html $DOKKU_LIB_ROOT/data/nginx-vhosts/dokku-errors/500-error.html
# patch broken nginx 1.8.0 logrotate

View File

@@ -2,7 +2,7 @@
<body style="padding:0; margin: 0;">
<div style="width:100%; height: 100%; text-align:center; font-family: arial; font-weight: bold; color: #ffffff; background: rgba(33, 129, 243, 0.66);">
<div style="position:absolute; top: 50%; left: 50%; transform: translateX(-50%) translateY(-50%);">
<h1>THERE HAS BEEN AN ERROR.</h1>
<h1>THERE HAS BEEN A 400 ERROR.</h1>
</div>
</div>
</body>

View File

@@ -2,7 +2,7 @@
<body style="padding:0; margin: 0;">
<div style="width:100%; height: 100%; text-align:center; font-family: arial; font-weight: bold; color: #ffffff; background: rgba(33, 129, 243, 0.66);">
<div style="position:absolute; top: 50%; left: 50%; transform: translateX(-50%) translateY(-50%);">
<h1>404. NOT FOUND.</h1>
<h1>THERE HAS BEEN A 404 ERROR.</h1>
</div>
</div>
</body>

View File

@@ -2,7 +2,7 @@
<body style="padding:0; margin: 0;">
<div style="width:100%; height: 100%; text-align:center; font-family: arial; font-weight: bold; color: #ffffff; background: rgba(33, 129, 243, 0.66);">
<div style="position:absolute; top: 50%; left: 50%; transform: translateX(-50%) translateY(-50%);">
<h1>THERE HAS BEEN AN ERROR.</h1>
<h1>THERE HAS BEEN A 500 ERROR.</h1>
</div>
</div>
</body>

View File

@@ -37,19 +37,19 @@ server {
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 {
root /etc/nginx/dokku-errors;
root $DOKKU_LIB_ROOT/data/nginx-vhosts/dokku-errors;
internal;
}
error_page 404 /404-error.html;
location /404-error.html {
root /etc/nginx/dokku-errors;
root $DOKKU_LIB_ROOT/data/nginx-vhosts/dokku-errors;
internal;
}
error_page 500 501 502 503 504 505 506 507 508 509 510 511 /500-error.html;
location /500-error.html {
root /etc/nginx/dokku-errors;
root $DOKKU_LIB_ROOT/data/nginx-vhosts/dokku-errors;
internal;
}
{{ end }}
@@ -93,19 +93,19 @@ server {
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 {
root /etc/nginx/dokku-errors;
root $DOKKU_LIB_ROOT/data/nginx-vhosts/dokku-errors;
internal;
}
error_page 404 /404-error.html;
location /404-error.html {
root /etc/nginx/dokku-errors;
root $DOKKU_LIB_ROOT/data/nginx-vhosts/dokku-errors;
internal;
}
error_page 500 501 502 503 504 505 506 507 508 509 510 511 /500-error.html;
location /500-error.html {
root /etc/nginx/dokku-errors;
root $DOKKU_LIB_ROOT/data/nginx-vhosts/dokku-errors;
internal;
}
}