Files
obdx-web/nginx.conf
kang 7193eacfa5 init: OBDX web landing (Bento Garage design)
- Vite + React + TS + Tailwind v4 + framer-motion + lucide
- 5 sections: Hero, Showcase (steps + 3 cases), Pricing, Comparison, Footer
- Brand assets local (logo v2 SVG, 3 mascots, 6 scenes) under public/brand/
- Dockerfile multi-stage (node 20 build → nginx 1.27 alpine)
- nginx /api/* reverse-proxy to obdx-api:8080, SPA fallback
- /healthz endpoint for Coolify

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 16:19:47 +08:00

53 lines
1.7 KiB
Nginx Configuration File

server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.html;
gzip on;
gzip_vary on;
gzip_min_length 1024;
gzip_types text/plain text/css text/xml application/json application/javascript application/xml+rss application/atom+xml image/svg+xml;
# Hash-named assets (Vite emits hashed filenames in /assets/) — long cache
location ~* ^/assets/.*\.(js|css|woff2?|ttf|otf|eot)$ {
expires 1y;
add_header Cache-Control "public, immutable";
try_files $uri =404;
}
# Brand images — versioned via filename, long cache
location ~* ^/brand/.*\.(png|jpg|jpeg|svg|webp|gif|ico)$ {
expires 30d;
add_header Cache-Control "public, max-age=2592000";
try_files $uri =404;
}
# Reverse proxy /api/* to FastAPI backend container.
# In Coolify the backend service hostname is the application name on the
# internal network. Override OBDX_API_UPSTREAM at deploy time if it differs.
location /api/ {
proxy_pass http://obdx-api:8080;
proxy_http_version 1.1;
proxy_set_header Host $host;
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;
proxy_read_timeout 60s;
proxy_connect_timeout 5s;
}
# SPA fallback — every non-asset path returns index.html so client routes work
location / {
try_files $uri $uri/ /index.html;
add_header Cache-Control "no-cache";
}
# Healthcheck for Coolify / load balancer
location = /healthz {
access_log off;
return 200 'ok';
add_header Content-Type text/plain;
}
}