Some checks are pending
Deploy to Production / deploy (push) Waiting to run
- Added .dockerignore to exclude unnecessary files from Docker builds - Enhanced .env.example with detailed configuration options and added MySQL settings - Created Gitea CI/CD workflow for automated production deployment with health checks - Added comprehensive Caddy server setup guide and configuration for reverse proxy - Created Caddyfile with secure defaults for SSL, compression, and security headers The changes focus on setting up a production-
92 lines
2.9 KiB
Plaintext
92 lines
2.9 KiB
Plaintext
# Nginx configuration for VPS
|
|
# Copy this to: /etc/nginx/sites-available/voxblog
|
|
# Then: sudo ln -s /etc/nginx/sites-available/voxblog /etc/nginx/sites-enabled/
|
|
|
|
# Option 1: Using subdomain (Recommended)
|
|
# DNS: voxblog.yourdomain.com → your-vps-ip
|
|
server {
|
|
listen 80;
|
|
server_name voxblog.yourdomain.com;
|
|
|
|
# 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;
|
|
|
|
# Frontend (React Admin)
|
|
location / {
|
|
proxy_pass http://127.0.0.1:3000;
|
|
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;
|
|
}
|
|
|
|
# API Backend
|
|
location /api {
|
|
proxy_pass http://127.0.0.1:3001;
|
|
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;
|
|
|
|
# Long timeout for AI streaming
|
|
proxy_read_timeout 600s;
|
|
proxy_send_timeout 600s;
|
|
proxy_connect_timeout 600s;
|
|
}
|
|
}
|
|
|
|
# Option 2: Using separate subdomains
|
|
# DNS: voxblog.yourdomain.com → your-vps-ip
|
|
# DNS: api.voxblog.yourdomain.com → your-vps-ip
|
|
|
|
# Frontend subdomain
|
|
# server {
|
|
# listen 80;
|
|
# server_name voxblog.yourdomain.com;
|
|
#
|
|
# location / {
|
|
# proxy_pass http://127.0.0.1:3000;
|
|
# 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;
|
|
# }
|
|
# }
|
|
|
|
# API subdomain
|
|
# server {
|
|
# listen 80;
|
|
# server_name api.voxblog.yourdomain.com;
|
|
#
|
|
# location / {
|
|
# proxy_pass http://127.0.0.1:3001;
|
|
# 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;
|
|
#
|
|
# # Long timeout for AI streaming
|
|
# proxy_read_timeout 600s;
|
|
# proxy_send_timeout 600s;
|
|
# proxy_connect_timeout 600s;
|
|
# }
|
|
# }
|