- Add separated Docker Compose architecture (astro/infrastructure/override) - Implement Directus + PostgreSQL with pinned versions (10.12.0/15.5-alpine) - Add comprehensive database safety protections and backup scripts - Configure production-ready NGINX reverse proxy setup - Add container names, labels, and enhanced healthchecks - Remove fallback environment variables for explicit production config - Include log rotation and monitoring improvements Infrastructure deployment: - npm run docker:infrastructure:up (one-time setup) - npm run docker:astro:up (regular deployments) - npm run db:backup/restore/status (database management) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
57 lines
1.9 KiB
Plaintext
57 lines
1.9 KiB
Plaintext
# NGINX Configuration for Black Canyon Tickets + Directus
|
|
# Copy to /etc/nginx/sites-available/blackcanyontickets
|
|
|
|
server {
|
|
listen 80;
|
|
listen 443 ssl http2;
|
|
server_name portal.blackcanyontickets.com;
|
|
|
|
# SSL Configuration - Certbot will handle this
|
|
ssl_certificate /etc/letsencrypt/live/portal.blackcanyontickets.com/fullchain.pem;
|
|
ssl_certificate_key /etc/letsencrypt/live/portal.blackcanyontickets.com/privkey.pem;
|
|
|
|
# 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;
|
|
|
|
# Redirect HTTP to HTTPS
|
|
if ($scheme != "https") {
|
|
return 301 https://$host$request_uri;
|
|
}
|
|
|
|
# Directus Admin - Route /admin to Directus
|
|
location /admin {
|
|
rewrite ^/admin/(.*) /$1 break;
|
|
proxy_pass http://localhost:8055;
|
|
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;
|
|
client_max_body_size 100M;
|
|
}
|
|
|
|
# Directus API - Route /api/directus to Directus
|
|
location /api/directus {
|
|
rewrite ^/api/directus/(.*) /$1 break;
|
|
proxy_pass http://localhost:8055;
|
|
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;
|
|
client_max_body_size 100M;
|
|
}
|
|
|
|
# Main Astro app - All other routes
|
|
location / {
|
|
proxy_pass http://localhost:3000;
|
|
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;
|
|
}
|
|
|
|
} |