All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
- Fixed search to properly escape special characters (parentheses, etc) - Changed nginx to not cache CSS/JS files aggressively - Updated image tags to v1.1.0 with Always pull policy - Images cache only 7 days instead of 1 year for CSS/JS
53 lines
1.7 KiB
YAML
53 lines
1.7 KiB
YAML
apiVersion: v1
|
|
kind: ConfigMap
|
|
metadata:
|
|
name: {{ include "oramap.fullname" . }}-nginx-config
|
|
labels:
|
|
app: {{ include "oramap.name" . }}-frontend
|
|
chart: {{ include "oramap.chart" . }}
|
|
release: {{ .Release.Name }}
|
|
heritage: {{ .Release.Service }}
|
|
data:
|
|
default.conf: |
|
|
server {
|
|
listen 80;
|
|
server_name _;
|
|
root /usr/share/nginx/html;
|
|
index index.html;
|
|
|
|
# Gzip compression
|
|
gzip on;
|
|
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
|
|
|
|
# Main location
|
|
location / {
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
|
|
# API proxy to backend service in Kubernetes
|
|
location /api/ {
|
|
proxy_pass http://{{ include "oramap.fullname" . }}-backend:{{ .Values.service.backend.port }};
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection 'upgrade';
|
|
proxy_set_header Host $host;
|
|
proxy_cache_bypass $http_upgrade;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
}
|
|
|
|
# No cache for CSS and JS to allow quick updates
|
|
location ~* \.(css|js)$ {
|
|
add_header Cache-Control "no-cache, no-store, must-revalidate";
|
|
add_header Pragma "no-cache";
|
|
add_header Expires "0";
|
|
}
|
|
|
|
# Cache images only
|
|
location ~* \.(jpg|jpeg|png|gif|ico|svg)$ {
|
|
expires 7d;
|
|
add_header Cache-Control "public, max-age=604800";
|
|
}
|
|
}
|