From 08143033442a94657138d1855ecaeefb26727f85 Mon Sep 17 00:00:00 2001 From: capitano Date: Sun, 12 Oct 2025 10:47:44 +0200 Subject: [PATCH] feat: Add custom 404 error page with image and UTF-8 encoding --- custom-404-page.yaml | 25 ++++++++++++++++++++++++ custom-404-server.yaml | 42 ++++++++++++++++++++++++++++++++++++++++ gemini-k8s-mediamtx.yaml | 9 ++++++++- 3 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 custom-404-page.yaml create mode 100644 custom-404-server.yaml diff --git a/custom-404-page.yaml b/custom-404-page.yaml new file mode 100644 index 0000000..e92b802 --- /dev/null +++ b/custom-404-page.yaml @@ -0,0 +1,25 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: custom-404-page + namespace: streaming +data: + index.html: | + + + + + Stream Offline + + + +

Stream Offline

+

Il flusso video non è attualmente disponibile. Riprova più tardi!

+ Stream Offline + + \ No newline at end of file diff --git a/custom-404-server.yaml b/custom-404-server.yaml new file mode 100644 index 0000000..6c0c628 --- /dev/null +++ b/custom-404-server.yaml @@ -0,0 +1,42 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: custom-404-server + namespace: streaming +spec: + replicas: 1 + selector: + matchLabels: + app: custom-404-server + template: + metadata: + labels: + app: custom-404-server + spec: + containers: + - name: nginx + image: nginx:alpine + ports: + - containerPort: 80 + volumeMounts: + - name: custom-404-volume + mountPath: /usr/share/nginx/html/index.html + subPath: index.html + volumes: + - name: custom-404-volume + configMap: + name: custom-404-page +--- +apiVersion: v1 +kind: Service +metadata: + name: custom-404-service + namespace: streaming +spec: + type: ClusterIP + selector: + app: custom-404-server + ports: + - protocol: TCP + port: 80 + targetPort: 80 diff --git a/gemini-k8s-mediamtx.yaml b/gemini-k8s-mediamtx.yaml index e146559..9c8925b 100644 --- a/gemini-k8s-mediamtx.yaml +++ b/gemini-k8s-mediamtx.yaml @@ -83,9 +83,16 @@ metadata: name: mediamtx-hls-ingress namespace: streaming annotations: - nginx.ingress.kubernetes.io/backend-protocol: "HTTP" # Assicurati che l'Ingress parli HTTP con il servizio HLS + nginx.ingress.kubernetes.io/backend-protocol: "HTTP" + nginx.ingress.kubernetes.io/custom-http-errors: "404" + nginx.ingress.kubernetes.io/default-backend: custom-404-service spec: ingressClassName: nginx + defaultBackend: + service: + name: custom-404-service + port: + number: 80 rules: - host: tv.giaco.net http: