canina/nginx.conf
DevOps 1b2040c880
Some checks failed
Deploy Canina / deploy (push) Failing after 8m3s
fix: production URLs for admin panel, seed __dirname, nginx.conf
2026-07-13 11:20:43 +00:00

62 lines
1.7 KiB
Nginx Configuration File

server {
listen 8080;
server_name canina.parsaaghayi.ir;
# 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_prod: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;
}
}
server {
listen 8080;
server_name admincanina.parsaaghayi.ir;
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_prod: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;
}
}