diff --git a/awx/static/RedHatDisplay-Medium.ttf b/awx/static/RedHatDisplay-Medium.ttf
new file mode 100644
index 0000000000..a3adad30a5
Binary files /dev/null and b/awx/static/RedHatDisplay-Medium.ttf differ
diff --git a/awx/static/RedHatDisplay-Regular.ttf b/awx/static/RedHatDisplay-Regular.ttf
new file mode 100644
index 0000000000..546554484b
Binary files /dev/null and b/awx/static/RedHatDisplay-Regular.ttf differ
diff --git a/awx/static/awx-spud-reading.svg b/awx/static/awx-spud-reading.svg
new file mode 100644
index 0000000000..9e1a02dfff
--- /dev/null
+++ b/awx/static/awx-spud-reading.svg
@@ -0,0 +1,383 @@
+
+
+
diff --git a/awx/static/custom_404.html b/awx/static/custom_404.html
new file mode 100644
index 0000000000..71350db7a1
--- /dev/null
+++ b/awx/static/custom_404.html
@@ -0,0 +1,7 @@
+
+
+ Redirecting
+
+
+ Redirecting
+
diff --git a/awx/static/custom_502.html b/awx/static/custom_502.html
new file mode 100644
index 0000000000..cc5ab94b4e
--- /dev/null
+++ b/awx/static/custom_502.html
@@ -0,0 +1,21 @@
+
+
+
+ On Break...
+
+
+
+
+
+
+

+
502
+
+
+
HTTP Response: 502
+
The spud is taking a much needed break...
+
Please check back later.
+
+
+
+
diff --git a/awx/static/custom_504.html b/awx/static/custom_504.html
new file mode 100644
index 0000000000..ba40e495bb
--- /dev/null
+++ b/awx/static/custom_504.html
@@ -0,0 +1,21 @@
+
+
+
+ On Break...
+
+
+
+
+
+
+

+
504
+
+
+
HTTP Response: 504
+
The spud is taking a much needed break...
+
Please check back later.
+
+
+
+
diff --git a/awx/static/custom_error.css b/awx/static/custom_error.css
new file mode 100644
index 0000000000..e52b535e80
--- /dev/null
+++ b/awx/static/custom_error.css
@@ -0,0 +1,82 @@
+@font-face {
+ font-family: redhat-display-medium;
+ src: url('./RedHatDisplay-Medium.ttf');
+}
+
+@font-face {
+ font-family: redhat-display-regular;
+ src: url('./RedHatDisplay-Regular.ttf');
+}
+
+html, body {
+ height:100%;
+ width:100%;
+}
+
+body {
+ background-color: #F0F0F0;
+}
+
+.container {
+ position: absolute;
+ top: 24px;
+ right: 24px;
+ bottom: 24px;
+ left: 24px;
+}
+
+.upper_div {
+ background-color: #F8EBA7;
+ justify-content: center;
+ align-items: center;
+ text-align: center;
+ height: 50%;
+ align-items: flex-end;
+ display: flex;
+ min-height: 450px;
+ width: 100%;
+}
+
+.main_image {
+ height: 450px;
+ width:auto;
+}
+
+.error_number {
+ position: absolute;
+ top: 23px;
+ right: 90px;
+ font-size:200px;
+ color: #FDBA48;
+ font-family: Impact, Haettenschweiler, "Franklin Gothic Bold", Charcoal, "Helvetica Inserat", "Bitstream Vera Sans Bold", "Arial Black", "sans serif";
+}
+
+.message_div {
+ background-color: #FFFFFF;
+ border: 1px solid #D2D2D2;
+ text-align: center;
+ height: 50%;
+ vertical-align: top;
+}
+
+.m1,.m2,.m3 {
+ color: #151515;
+ width: 100%;
+ font-family: redhat-display-medium;
+}
+
+.m1 {
+ font-size: 24px;
+ padding-top: 24px;
+}
+
+.m2 {
+ font-size: 20px;
+ padding-top: 20px;
+}
+
+.m3 {
+ font-size: 16px;
+ padding-top: 20px;
+ font-family: redhat-display-regular;
+}
diff --git a/tools/docker-compose/ansible/roles/sources/tasks/main.yml b/tools/docker-compose/ansible/roles/sources/tasks/main.yml
index 17ab4dc0c9..417807f02b 100644
--- a/tools/docker-compose/ansible/roles/sources/tasks/main.yml
+++ b/tools/docker-compose/ansible/roles/sources/tasks/main.yml
@@ -42,6 +42,16 @@
dest: "{{ sources_dest }}/SECRET_KEY"
no_log: true
+- name: Find custom error pages
+ set_fact:
+ custom_error_pages: "{{ (custom_error_pages | default([])) + [new_error_page] }}"
+ vars:
+ new_error_page:
+ error_code: "{{ item | basename() | regex_replace('custom_(\\d+).html', '\\1') }}"
+ web_path: "{{ item | regex_replace('^.*\/static', '/static') }}"
+ loop: "{{ lookup('ansible.builtin.fileglob', playbook_dir + '/../../../awx/static/custom_*.html', wantlist=True) }}"
+ when: (item | basename()) is regex("custom_\d+\.html")
+
- name: Render configuration templates
template:
src: "{{ item }}.j2"
diff --git a/tools/docker-compose/ansible/roles/sources/templates/nginx.conf.j2 b/tools/docker-compose/ansible/roles/sources/templates/nginx.conf.j2
index ff7e2ab386..7115e15582 100644
--- a/tools/docker-compose/ansible/roles/sources/templates/nginx.conf.j2
+++ b/tools/docker-compose/ansible/roles/sources/templates/nginx.conf.j2
@@ -44,6 +44,11 @@ http {
add_header Strict-Transport-Security max-age=15768000;
add_header X-Content-Type-Options nosniff;
+ # Pretty error pages
+ {% for error_page in custom_error_pages %}
+ error_page {{ error_page.error_code }} {{ error_page.web_path }};
+ {% endfor %}
+
include /etc/nginx/conf.d/*.conf;
}
@@ -70,6 +75,10 @@ http {
add_header Strict-Transport-Security max-age=15768000;
add_header X-Content-Type-Options nosniff;
+ # Pretty error pages
+ {% for error_page in custom_error_pages %}
+ error_page {{ error_page.error_code }} {{ error_page.web_path }};
+ {% endfor %}
include /etc/nginx/conf.d/*.conf;
}