From ef7e662060065774739394493fa70864649aaeea Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Wed, 28 Jan 2026 09:02:50 +0100 Subject: [PATCH] updated nginx config --- felhom-system/webpage.yaml | 42 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/felhom-system/webpage.yaml b/felhom-system/webpage.yaml index 2b48b72..fb37c32 100644 --- a/felhom-system/webpage.yaml +++ b/felhom-system/webpage.yaml @@ -43,6 +43,42 @@ data: } --- # =================== +# NGINX CONFIG FOR CLEAN URLs +# =================== +apiVersion: v1 +kind: ConfigMap +metadata: + name: nginx-config + namespace: felhom-system +data: + default.conf: | + server { + listen 80; + server_name _; + root /usr/share/nginx/html; + index index.html; + + # Enable clean URLs - serve .html files without extension + location / { + try_files $uri $uri.html $uri/ =404; + } + + # Cache static assets + location ~* \.(css|js|png|jpg|jpeg|gif|ico|svg|woff|woff2)$ { + expires 7d; + add_header Cache-Control "public, immutable"; + } + + # Security headers + add_header X-Frame-Options "SAMEORIGIN" always; + add_header X-Content-Type-Options "nosniff" always; + + # Error pages + error_page 404 /404.html; + error_page 500 502 503 504 /50x.html; + } +--- +# =================== # FILEBROWSER # =================== apiVersion: apps/v1 @@ -171,6 +207,9 @@ spec: volumeMounts: - name: website-content mountPath: /usr/share/nginx/html + - name: nginx-config + mountPath: /etc/nginx/conf.d/default.conf + subPath: default.conf resources: requests: memory: "32Mi" @@ -194,6 +233,9 @@ spec: - name: website-content persistentVolumeClaim: claimName: felhom-website-content + - name: nginx-config + configMap: + name: nginx-config --- apiVersion: v1 kind: Service