Files
asepharyana-hub/infra/dashboard/nginx.conf
T

93 lines
2.4 KiB
Nginx Configuration File

# Dashboard nginx — runs as root to access Docker socket
user root;
worker_processes auto;
pid /var/run/nginx.pid;
pcre_jit on;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /var/log/nginx/access.log;
sendfile on;
tcp_nopush on;
keepalive_timeout 65;
# Gzip
gzip on;
gzip_types text/html text/css application/javascript application/json;
server {
listen 8080;
server_name localhost;
root /usr/share/nginx/html;
index index.html;
# Security headers
add_header X-Frame-Options DENY;
add_header X-Content-Type-Options nosniff;
add_header Referrer-Policy same-origin;
# Jaeger API proxy
location /api/jaeger/ {
proxy_pass http://jaeger:16686/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_http_version 1.1;
proxy_read_timeout 30s;
}
# Jaeger UI
location /jaeger/ {
proxy_pass http://jaeger:16686/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout 86400s;
}
# OTel collector prometheus metrics
location /api/metrics {
proxy_pass http://otel-collector:8889/metrics;
proxy_set_header Host $host;
proxy_read_timeout 10s;
}
# OTel collector health
location /api/health {
proxy_pass http://otel-collector:13133/;
proxy_set_header Host $host;
proxy_read_timeout 5s;
}
# Docker API proxy (read-only Unix socket)
location /api/docker/ {
proxy_pass http://unix:/var/run/docker.sock:/;
proxy_set_header Host $host;
proxy_read_timeout 10s;
}
# Static files
location / {
try_files $uri $uri/ /index.html;
expires 5s;
add_header Cache-Control "public, must-revalidate";
}
# Deny hidden files
location ~ /\. {
deny all;
access_log off;
log_not_found off;
}
error_page 404 /index.html;
}
}