diff --git a/Dockerfile b/Dockerfile index c70f0436..8edd21db 100644 --- a/Dockerfile +++ b/Dockerfile @@ -73,6 +73,9 @@ RUN mkdir -p /usr/share/nginx/html/online/osconsole && \ COPY docker/nginx.js docker/rbac.js docker/js-yaml.js docker/jwt-decode.js /etc/nginx/conf.d/ COPY docker/nginx.conf docker/nginx-gateway.conf.template docker/nginx-gateway-k8s.conf.template docker/osconsole/config.sh docker/nginx.sh docker/ACL.yaml / +COPY docker/hawtio-50x.html /usr/share/nginx/html +COPY docker/hawtio-404.html /usr/share/nginx/html + # Copy licenses RUN mkdir -p /opt/hawtio/licenses COPY docker/licenses /opt/hawtio/licenses diff --git a/docker/hawtio-404.html b/docker/hawtio-404.html new file mode 100644 index 00000000..8a1a3d63 --- /dev/null +++ b/docker/hawtio-404.html @@ -0,0 +1,13 @@ +
diff --git a/docker/hawtio-50x.html b/docker/hawtio-50x.html new file mode 100644 index 00000000..2f2b2134 --- /dev/null +++ b/docker/hawtio-50x.html @@ -0,0 +1,13 @@ + diff --git a/docker/nginx-gateway-k8s.conf.template b/docker/nginx-gateway-k8s.conf.template index d71179b7..b3933787 100644 --- a/docker/nginx-gateway-k8s.conf.template +++ b/docker/nginx-gateway-k8s.conf.template @@ -36,6 +36,16 @@ server { rewrite ^ $new redirect; } + error_page 404 /hawtio-404.html; + location = /hawtio-404.html { + internal; + } + + error_page 500 502 503 504 /hawtio-50x.html; + location = /hawtio-50x.html { + internal; + } + # Static content serving location /online { add_header location-rule ONLINE always; diff --git a/docker/nginx-gateway.conf.template b/docker/nginx-gateway.conf.template index f3d46b0b..b01d4c0f 100644 --- a/docker/nginx-gateway.conf.template +++ b/docker/nginx-gateway.conf.template @@ -36,6 +36,16 @@ server { rewrite ^ $new redirect; } + error_page 404 /hawtio-404.html; + location = /hawtio-404.html { + internal; + } + + error_page 500 502 503 504 /hawtio-50x.html; + location = /hawtio-50x.html { + internal; + } + # Static content serving location /online { add_header location-rule ONLINE always; diff --git a/docker/nginx.conf b/docker/nginx.conf index e4256ab9..cd1b4574 100644 --- a/docker/nginx.conf +++ b/docker/nginx.conf @@ -20,6 +20,16 @@ server { rewrite ^ $new redirect; } + error_page 404 /hawtio-404.html; + location = /hawtio-404.html { + internal; + } + + error_page 500 502 503 504 /hawtio-50x.html; + location = /hawtio-50x.html { + internal; + } + # Static content serving location /online { alias /usr/share/nginx/html/online;