Browse Source

Custom error

main
Roberto Alsina 3 months ago
parent
commit
145228b4b6
  1. 3
      Dockerfile
  2. 4
      custom_50x.html
  3. 10
      nginx.conf

3
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

4
custom_50x.html

@ -0,0 +1,4 @@
<center>
<marquee>We seem to be having some technical difficulties. Hang tight.</marquee>
<img src="https://64.media.tumblr.com/835be7a6a0f8bd9422190520597061dc/tumblr_nqaedpjO5Z1tszwcio1_540.jpg" style"width:100%;">
</center>

10
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;
}
}

Loading…
Cancel
Save