Files
ERP/pm/frontend/nginx.conf
T
MMD 2747f9d4bb chore(pm): vendor the Aramesh/PM platform under pm/ (squash of Aramesh/PM @ 91f3271)
The PM panel (PmPanelPage -> iframe /pm/) needs the project-management
platform served at /pm/ on the ERP domain. Source: org repo Aramesh/PM,
branch feature/project-management-platform. Update via:
git subtree pull --prefix=pm aramesh-pm feature/project-management-platform --squash
2026-10-07 15:14:20 +03:30

59 lines
1.9 KiB
Nginx Configuration File

server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.html;
client_max_body_size 15m;
# PM روی همان دامنه ERP زیر پیشوند /pm سرو می‌شود (پنل «مدیریت پروژه»).
# پروکسی API به بک‌اند PM — هم زیر /pm/api (ادغام با ERP) هم /api (دسترسی مستقیم)
location /pm/api/ {
proxy_pass http://pm-api:8000/api/;
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;
}
location /api/ {
proxy_pass http://pm-api:8000;
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;
}
# SPA زیر /pm/ — نقطه ورود پنل «مدیریت پروژه» روی دامنه ERP
location /pm/ {
alias /usr/share/nginx/html/;
try_files $uri $uri/ /pm/index.html;
}
location = /pm {
return 301 /pm/;
}
location = /pm/index.html {
add_header Cache-Control "no-cache, no-store, must-revalidate";
alias /usr/share/nginx/html/index.html;
}
# SPA fallback (دسترسی مستقیم به فرانت PM بدون پیشوند)
location / {
try_files $uri $uri/ /index.html;
}
# index.html همیشه بدون کش
location = /index.html {
add_header Cache-Control "no-cache, no-store, must-revalidate";
try_files $uri =404;
}
# فایل‌های استاتیک هش‌دار با کش بلندمدت
location /assets/ {
add_header Cache-Control "public, max-age=31536000, immutable";
try_files $uri =404;
}
}