diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index ad0e0f5ea16b08de359a1a2a06e256a3733c9043..7f42775d82fece0a9d72b66a460d9cac235091e7 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -32,6 +32,8 @@ deploy_test:
   script:
     - echo "deploying test"
     - cp ./nginx_snippets/* /etc/nginx/snippets/
+    - mkdir -p /opt/strudel2/errors/
+    - cp ./html/* /opt/strudel2/errors/
     - docker login -u $DOCKERHUBUSER -p $DOCKERHUBPASSWORD docker.io
     - docker stop strudel2_backend || echo "Failed to stop existing container"
     - docker ps -a -q | xargs -I{} docker rm  {} || echo "No containers to remove"
@@ -52,6 +54,8 @@ deploy_dev:
   script:
     - echo "deploying dev"
     - cp ./nginx_snippets/* /etc/nginx/snippets/
+    - mkdir -p /opt/strudel2/errors/
+    - cp ./html/* /opt/strudel2/errors/
     - docker login -u $DOCKERHUBUSER -p $DOCKERHUBPASSWORD docker.io
     - docker stop strudel2_backend || echo "Failed to stop existing container"
     - docker ps -a -q | xargs -I{} docker rm  {} || echo "No containers to remove"
@@ -72,6 +76,8 @@ deploy_prod:
   script:
     - echo "deploying prod"
     - cp ./nginx_snippets/* /etc/nginx/snippets/
+    - mkdir -p /opt/strudel2/errors/
+    - cp ./html/* /opt/strudel2/errors/
     - docker login -u $DOCKERHUBUSER -p $DOCKERHUBPASSWORD docker.io
     - docker stop strudel2_backend || echo "Failed to stop existing container"
     - docker ps -a -q | xargs -I{} docker rm  {} || echo "No containers to remove"
diff --git a/html/502.html b/html/502.html
new file mode 100644
index 0000000000000000000000000000000000000000..1c6e707e9ae997e19be5e83d502ac17aab4d49a9
--- /dev/null
+++ b/html/502.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<pre id="log"></pre>
+<html>
+	<head> </head>
+	<body> 
+		Something isn't quite right<p>
+		Usually this indicates that the cluster hasn't quite managed to start your program and reloading this page should fix the issue<p>
+		This page should reload in a few seconds.<p>
+		If that still doesn't work, try closing this tab and clicking connect again
+	</body>
+<script>
+function sleep(ms, f)
+{
+    return(
+        setTimeout(f, ms)
+    )
+}
+
+sleep(5000, function() {
+		window.location.reload()
+           })
+</script>
+</html>
+
diff --git a/nginx_snippets/tes.conf b/nginx_snippets/tes.conf
index f108c732dfa5c04f494df8a240274f4dd507b54d..f5b1d8bb37c439e04f4b07b2cdc74ca478e80bb5 100644
--- a/nginx_snippets/tes.conf
+++ b/nginx_snippets/tes.conf
@@ -1,3 +1,9 @@
+error_page 502 /502.html;
+location /502.html {
+   root /opt/strudel2/errors/;
+}
+
+
 location /tes/ {
 	proxy_pass http://localhost:8080/;
 	proxy_http_version 1.1;