diff --git a/Dockerfile b/Dockerfile index dd78ed7..9e0eceb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,6 +3,7 @@ FROM haproxy:1.8-alpine RUN apk add --no-cache bash COPY entrypoint.sh / +COPY assets/errors-custom/* /etc/haproxy/errors-custom/ ENTRYPOINT [ "/entrypoint.sh" ] -CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] \ No newline at end of file +CMD ["haproxy", "-f", "/etc/haproxy/haproxy.cfg"] \ No newline at end of file diff --git a/assets/errors-custom/400.http b/assets/errors-custom/400.http new file mode 100644 index 0000000..8e653cb --- /dev/null +++ b/assets/errors-custom/400.http @@ -0,0 +1,25 @@ +HTTP/1.0 400 Bad request +Cache-Control: no-cache +Connection: close +Content-Type: text/html + + + + + + 400 Bad request + + + + + + +
+
400
+
Bad request
+
+ + + diff --git a/assets/errors-custom/403.http b/assets/errors-custom/403.http new file mode 100644 index 0000000..b2cc8b9 --- /dev/null +++ b/assets/errors-custom/403.http @@ -0,0 +1,25 @@ +HTTP/1.0 403 Forbidden +Cache-Control: no-cache +Connection: close +Content-Type: text/html + + + + + + 403 Forbidden + + + + + + +
+
403
+
Forbidden
+
+ + + diff --git a/assets/errors-custom/408.http b/assets/errors-custom/408.http new file mode 100644 index 0000000..f3400e7 --- /dev/null +++ b/assets/errors-custom/408.http @@ -0,0 +1,25 @@ +HTTP/1.0 408 Request Time-out +Cache-Control: no-cache +Connection: close +Content-Type: text/html + + + + + + 408 Request Time-out + + + + + + +
+
408
+
Request Time-out
+
+ + + diff --git a/assets/errors-custom/500.http b/assets/errors-custom/500.http new file mode 100644 index 0000000..d1b0487 --- /dev/null +++ b/assets/errors-custom/500.http @@ -0,0 +1,25 @@ +HTTP/1.0 500 Server Error +Cache-Control: no-cache +Connection: close +Content-Type: text/html + + + + + + 500 Server Error + + + + + + +
+
500
+
Server Error
+
+ + + diff --git a/assets/errors-custom/502.http b/assets/errors-custom/502.http new file mode 100644 index 0000000..be2f81b --- /dev/null +++ b/assets/errors-custom/502.http @@ -0,0 +1,25 @@ +HTTP/1.0 502 Bad Gateway +Cache-Control: no-cache +Connection: close +Content-Type: text/html + + + + + + 502 Bad Gateway + + + + + + +
+
502
+
Bad Gateway
+
+ + + diff --git a/assets/errors-custom/503.http b/assets/errors-custom/503.http new file mode 100644 index 0000000..b08519b --- /dev/null +++ b/assets/errors-custom/503.http @@ -0,0 +1,25 @@ +HTTP/1.0 503 Service Unavailable +Cache-Control: no-cache +Connection: close +Content-Type: text/html + + + + + + 503 Service Unavailable + + + + + + +
+
503
+
Service Unavailable
+
+ + + diff --git a/assets/errors-custom/504.http b/assets/errors-custom/504.http new file mode 100644 index 0000000..8c874c0 --- /dev/null +++ b/assets/errors-custom/504.http @@ -0,0 +1,25 @@ +HTTP/1.0 504 Gateway Time-out +Cache-Control: no-cache +Connection: close +Content-Type: text/html + + + + + + 504 Gateway Time-out + + + + + + +
+
504
+
Gateway Time-out
+
+ + + diff --git a/entrypoint.sh b/entrypoint.sh index b0e66f8..b50d947 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -18,6 +18,14 @@ defaults timeout client 10s timeout server 10m + errorfile 400 /etc/haproxy/errors-custom/400.http + errorfile 403 /etc/haproxy/errors-custom/403.http + errorfile 408 /etc/haproxy/errors-custom/408.http + errorfile 500 /etc/haproxy/errors-custom/500.http + errorfile 502 /etc/haproxy/errors-custom/502.http + errorfile 503 /etc/haproxy/errors-custom/503.http + errorfile 504 /etc/haproxy/errors-custom/504.http + global log 127.0.0.1 local0 notice maxconn 2000 @@ -84,7 +92,7 @@ backend srv_80_$COUNT } -HAPROXY_CFG="/usr/local/etc/haproxy/haproxy.cfg" +HAPROXY_CFG="/etc/haproxy/haproxy.cfg" FRONTEND="" BACKEND="" TURN="FB"