From 145228b4b660bc24c8972ee32fe6fe6a77ebed0b Mon Sep 17 00:00:00 2001 From: Roberto Alsina Date: Mon, 27 Jun 2022 17:18:19 -0300 Subject: [PATCH] Custom error --- Dockerfile | 3 ++- custom_50x.html | 4 ++++ nginx.conf | 10 ++++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 custom_50x.html diff --git a/Dockerfile b/Dockerfile index d01a39d..244bc6a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,8 +20,9 @@ RUN apk update && apk add --no-cache ca-certificates iptables ip6tables nginx COPY --from=builder /app/start.sh /app/start.sh COPY --from=tailscale /app/tailscaled /app/tailscaled COPY --from=tailscale /app/tailscale /app/tailscale -RUN mkdir -p /var/run/tailscale /var/cache/tailscale /var/lib/tailscale +RUN mkdir -p /var/run/tailscale /var/cache/tailscale /var/lib/tailscale /usr/share/nginx/html COPY nginx.conf /etc/nginx/http.d/nginx.conf +COPY custom_50x.html /usr/share/nginx/html/ # Run on container startup. EXPOSE 8080 diff --git a/custom_50x.html b/custom_50x.html new file mode 100644 index 0000000..3a7e318 --- /dev/null +++ b/custom_50x.html @@ -0,0 +1,4 @@ +
+We seem to be having some technical difficulties. Hang tight. + +
diff --git a/nginx.conf b/nginx.conf index 5a094c9..a289f4d 100644 --- a/nginx.conf +++ b/nginx.conf @@ -8,6 +8,11 @@ server { proxy_pass http://pinky.ralsina.github.beta.tailscale.net:8080; proxy_set_header X-Forwarded-Host $http_host; } + error_page 500 502 503 504 /custom_50x.html; + location = /custom_50x.html { + root /usr/share/nginx/html; + internal; + } } server { @@ -21,4 +26,9 @@ server { proxy_pass http://pinky.ralsina.github.beta.tailscale.net:3000; proxy_set_header X-Forwarded-Host $http_host; } + error_page 403 404 500 502 503 504 /custom_50x.html; + location = /custom_50x.html { + root /usr/share/nginx/html; + internal; + } }