62 lines
1.7 KiB
Nginx Configuration File
62 lines
1.7 KiB
Nginx Configuration File
# ⒸAngelaMos | 2025
|
|
# Development Nginx Configuration
|
|
# Features:
|
|
# - Proxies to Vite dev server (with HMR/WebSocket support)
|
|
# - Proxies /api to FastAPI backend
|
|
# - No caching, no SSL
|
|
|
|
events {
|
|
worker_connections 1024;
|
|
}
|
|
|
|
http {
|
|
# Include shared config
|
|
include /etc/nginx/http.conf;
|
|
|
|
# Disable access logs in dev (less noise)
|
|
access_log off;
|
|
error_log /var/log/nginx/error.log warn;
|
|
|
|
server {
|
|
listen 80;
|
|
server_name localhost;
|
|
|
|
# Client max body size (for file uploads in scans)
|
|
client_max_body_size 10M;
|
|
|
|
# Backend API routes
|
|
location /api/ {
|
|
proxy_pass http://backend:8000/;
|
|
|
|
# Apply common proxy settings
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection 'upgrade';
|
|
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_cache_bypass $http_upgrade;
|
|
}
|
|
|
|
# Frontend (Vite dev server with HMR)
|
|
location / {
|
|
proxy_pass http://frontend;
|
|
|
|
# WebSocket support for Vite HMR
|
|
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;
|
|
}
|
|
|
|
# Health check endpoint
|
|
location /health {
|
|
access_log off;
|
|
return 200 "healthy\n";
|
|
add_header Content-Type text/plain;
|
|
}
|
|
}
|
|
}
|