# Place under /etc/nginx/sites-available/adm.montzar.ir # SSL: assume Certbot already issued for adm.montzar.ir (or enable after first HTTP). # # Single domain: SPA at / + Nest API under /api + public get_user/get_version + uploads. upstream superadmin_api { server 127.0.0.1:3010; keepalive 8; } server { listen 80; listen [::]:80; server_name adm.montzar.ir; return 301 https://$host$request_uri; } server { listen 443 ssl http2; listen [::]:443 ssl http2; server_name adm.montzar.ir; # Certbot paths — adjust if different on this host ssl_certificate /etc/letsencrypt/live/adm.montzar.ir/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/adm.montzar.ir/privkey.pem; include /etc/letsencrypt/options-ssl-nginx.conf; ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; root /var/www/superadmin/web/dist; index index.html; client_max_body_size 20M; location /api/ { proxy_pass http://superadmin_api; 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; } location = /get_user { proxy_pass http://superadmin_api; 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; } location = /get_version { proxy_pass http://superadmin_api; 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; } location = /manifest.json { proxy_pass http://superadmin_api; 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; } location /uploads/ { proxy_pass http://superadmin_api; 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; } location / { try_files $uri $uri/ /index.html; } }