Files
coastal_timesheet/docker/nginx/default.conf
T
BizzleBot a7c138add1 v2.0.0: Complete rewrite — React + Express + PostgreSQL + Docker
BREAKING: Full rewrite from static HTML to production-grade stack.

Features:
- React 18 + Vite + Tailwind CSS (mobile-first)
- Express + Prisma + PostgreSQL backend
- JWT authentication with role-based access
- Weekly Mon-Sun timesheets with auto-save
- Multiple homeowner entries per day
- Submit → Approve/Reject workflow
- Server-side PDF generation
- SMTP email integration
- Admin panel with reporting & filters
- Dark mode (system-aware)
- Docker Compose one-command deploy
- Non-root containers, Helmet, bcrypt, Zod validation
2026-02-15 20:16:46 +00:00

82 lines
2.4 KiB
Plaintext

# Coastal Timesheet — Nginx reverse proxy
# /api/* → backend:3001
# /* → frontend static files
upstream backend_api {
server backend:3001;
keepalive 16;
}
server {
listen 80;
listen [::]:80;
server_name _;
# Security headers
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-XSS-Protection "1; mode=block" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
# Gzip compression
gzip on;
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_min_length 256;
gzip_types
text/plain
text/css
text/xml
text/javascript
application/json
application/javascript
application/xml
application/rss+xml
image/svg+xml;
# Client body size (for file uploads if ever needed)
client_max_body_size 10m;
# ─── API proxy ───────────────────────────────────────
location /api/ {
proxy_pass http://backend_api;
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;
# Timeouts for PDF generation / email sending
proxy_read_timeout 60s;
proxy_connect_timeout 10s;
proxy_send_timeout 30s;
}
# ─── Frontend static files ───────────────────────────
location / {
root /usr/share/nginx/html;
index index.html;
# SPA fallback — serve index.html for client-side routes
try_files $uri $uri/ /index.html;
# Cache static assets aggressively
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
expires 1y;
add_header Cache-Control "public, immutable";
access_log off;
}
}
# ─── Health check endpoint for load balancer ─────────
location = /nginx-health {
access_log off;
return 200 'ok';
add_header Content-Type text/plain;
}
}