Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for custom error pages #3

Merged
merged 1 commit into from
Jul 4, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
build/
deploy/public
2 changes: 2 additions & 0 deletions config.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
set :build_dir, 'deploy/public'

# Activate and configure extensions
# https://middlemanapp.com/advanced/configuration/#configuring-extensions

Expand Down
6 changes: 6 additions & 0 deletions deploy/Staticfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# We upload the entire deploy directory which includes the build directory and
# config, but only want to serve the build directory (deploy/public)
root: public

# Include e.g. custom error page config within the nginx location block
location_include: includes/*.conf
3 changes: 3 additions & 0 deletions deploy/nginx/conf/includes/error_pages.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
error_page 404 /errors/404.html;
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 500 501 502 503 504 505 506 507 508 509 510 511 /errors/generic.html;

2 changes: 1 addition & 1 deletion manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
applications:
- name: govuk-design-system-production
memory: 64M
path: ./build
path: ./deploy
buildpack: staticfile_buildpack
1 change: 1 addition & 0 deletions source/errors/404.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<h1>404 Not Found</h1>
1 change: 1 addition & 0 deletions source/errors/generic.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<h1>Something went wrong</h1>