mirror of
https://github.com/alexandrev/xslt-lab.git
synced 2026-09-13 08:43:16 +00:00
2b2a16ed43
Instrument the Go backend with Prometheus metrics (HTTP request rate/ latency/in-flight and per-version transformation outcomes, Saxon duration, payload size, trace usage), exposed on a dedicated internal port 9100 so they are never routed through the public ingress. Add an nginx exporter sidecar to the frontend. Ship ServiceMonitors (release=kube-prom-stack) and a Grafana dashboard ConfigMap via the Helm chart. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
70 lines
1.6 KiB
Nginx Configuration File
70 lines
1.6 KiB
Nginx Configuration File
worker_processes auto;
|
|
|
|
events {
|
|
worker_connections 1024;
|
|
}
|
|
|
|
http {
|
|
include /etc/nginx/mime.types;
|
|
default_type application/octet-stream;
|
|
sendfile on;
|
|
tcp_nopush on;
|
|
|
|
gzip on;
|
|
gzip_vary on;
|
|
gzip_proxied any;
|
|
gzip_comp_level 6;
|
|
gzip_min_length 1000;
|
|
gzip_types
|
|
text/plain
|
|
text/css
|
|
text/javascript
|
|
application/javascript
|
|
application/json
|
|
application/xml
|
|
image/svg+xml
|
|
font/woff2;
|
|
|
|
# Internal endpoint scraped by the nginx-prometheus-exporter sidecar.
|
|
# Bound to localhost only; never reachable from outside the pod.
|
|
server {
|
|
listen 127.0.0.1:8081;
|
|
location = /stub_status {
|
|
stub_status;
|
|
}
|
|
location / {
|
|
return 404;
|
|
}
|
|
}
|
|
|
|
server {
|
|
listen 80;
|
|
root /usr/share/nginx/html;
|
|
index index.html;
|
|
|
|
# Long-lived cache for hashed assets (JS/CSS chunks)
|
|
location ~* \.(js|css)$ {
|
|
add_header Cache-Control "public, max-age=31536000, immutable";
|
|
try_files $uri =404;
|
|
}
|
|
|
|
# Cache static assets
|
|
location ~* \.(svg|ico|png|jpg|jpeg|woff2|woff)$ {
|
|
add_header Cache-Control "public, max-age=604800";
|
|
try_files $uri =404;
|
|
}
|
|
|
|
# env.js must never be cached (runtime config)
|
|
location = /env.js {
|
|
add_header Cache-Control "no-store";
|
|
try_files $uri =404;
|
|
}
|
|
|
|
# SPA fallback
|
|
location / {
|
|
try_files $uri $uri/ /index.html;
|
|
add_header Cache-Control "no-cache";
|
|
}
|
|
}
|
|
}
|