feat: Add custom 404 error page with image and UTF-8 encoding
This commit is contained in:
25
custom-404-page.yaml
Normal file
25
custom-404-page.yaml
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: custom-404-page
|
||||||
|
namespace: streaming
|
||||||
|
data:
|
||||||
|
index.html: |
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Stream Offline</title>
|
||||||
|
<style>
|
||||||
|
body { font-family: Arial, sans-serif; text-align: center; padding-top: 50px; background-color: #f0f0f0; }
|
||||||
|
h1 { color: #333; }
|
||||||
|
p { color: #666; }
|
||||||
|
img { max-width: 80%; height: auto; margin-top: 20px; }
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Stream Offline</h1>
|
||||||
|
<p>Il flusso video non è attualmente disponibile. Riprova più tardi!</p>
|
||||||
|
<img src="https://www.animamia.net/wp-content/uploads/2015/04/sigle_tv_21.jpg" alt="Stream Offline">
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
42
custom-404-server.yaml
Normal file
42
custom-404-server.yaml
Normal file
@@ -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
|
||||||
@@ -83,9 +83,16 @@ metadata:
|
|||||||
name: mediamtx-hls-ingress
|
name: mediamtx-hls-ingress
|
||||||
namespace: streaming
|
namespace: streaming
|
||||||
annotations:
|
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:
|
spec:
|
||||||
ingressClassName: nginx
|
ingressClassName: nginx
|
||||||
|
defaultBackend:
|
||||||
|
service:
|
||||||
|
name: custom-404-service
|
||||||
|
port:
|
||||||
|
number: 80
|
||||||
rules:
|
rules:
|
||||||
- host: tv.giaco.net
|
- host: tv.giaco.net
|
||||||
http:
|
http:
|
||||||
|
|||||||
Reference in New Issue
Block a user