All checks were successful
Deploy Canina / deploy (push) Successful in 5m39s
- Backend Dockerfile: add chown for node_modules (Prisma permissions fix) - Frontend Dockerfile: add ARG/ENV for NEXT_PUBLIC_API_URL, VITE_API_URL - nginx.conf: template with __PLACEHOLDERS__ for per-env substitution - deploy.yml: SSH keepalive, sudo for VPN - api.ts: dynamic API URL via env vars instead of hardcoded - next.config.ts: rewrite only in development mode - scripts: deploy.sh, compose.stage.yml, compose.prod.yml
64 lines
1.8 KiB
Nginx Configuration File
64 lines
1.8 KiB
Nginx Configuration File
server {
|
|
listen 8080;
|
|
server_name __APP_HOST__;
|
|
|
|
# Security Headers
|
|
server_tokens off;
|
|
add_header X-Frame-Options "SAMEORIGIN" always;
|
|
add_header X-XSS-Protection "1; mode=block" always;
|
|
add_header X-Content-Type-Options "nosniff" always;
|
|
add_header Referrer-Policy "no-referrer-when-downgrade" always;
|
|
|
|
# Main Application (Next.js)
|
|
location / {
|
|
proxy_pass http://localhost:3000;
|
|
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;
|
|
}
|
|
|
|
# Backend API
|
|
location /api {
|
|
proxy_pass http://__BACKEND_HOST__:3000;
|
|
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;
|
|
client_max_body_size 50M;
|
|
}
|
|
}
|
|
|
|
server {
|
|
listen 8080;
|
|
server_name __ADMIN_HOST__;
|
|
|
|
root /app/admin_static;
|
|
index index.html;
|
|
|
|
# Security Headers
|
|
server_tokens off;
|
|
add_header X-Frame-Options "SAMEORIGIN" always;
|
|
add_header X-XSS-Protection "1; mode=block" always;
|
|
add_header X-Content-Type-Options "nosniff" always;
|
|
add_header Referrer-Policy "no-referrer-when-downgrade" always;
|
|
|
|
# SPA routing for Admin Panel
|
|
location / {
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
|
|
# Backend API for Admin
|
|
location /api {
|
|
proxy_pass http://__BACKEND_HOST__:3000;
|
|
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;
|
|
client_max_body_size 50M;
|
|
}
|
|
}
|