Wire production domain, CORS for tenant subdomains, celery volume mounts, and nginx reverse proxy configs for apex, API, identity, auth, and wildcard tenants. Co-authored-by: Cursor <cursoragent@cursor.com>
151 lines
4.8 KiB
Plaintext
151 lines
4.8 KiB
Plaintext
# ============================================================
|
|
# torbatyar.ir HTTPS — cert: /etc/letsencrypt/live/torbatyar.ir/
|
|
# (apex + www + api + identity + auth on one cert)
|
|
# Tenant wildcard *.torbatyar.ir still needs DNS-01 cert later.
|
|
# ============================================================
|
|
|
|
upstream torbatyar_frontend {
|
|
server 192.168.10.162:3000;
|
|
keepalive 16;
|
|
}
|
|
upstream torbatyar_core {
|
|
server 192.168.10.162:8000;
|
|
keepalive 16;
|
|
}
|
|
upstream torbatyar_identity {
|
|
server 192.168.10.162:8001;
|
|
keepalive 16;
|
|
}
|
|
upstream torbatyar_keycloak {
|
|
server 192.168.10.162:8080;
|
|
keepalive 8;
|
|
}
|
|
|
|
# Force HTTPS for known hosts
|
|
server {
|
|
listen 192.168.10.156:80;
|
|
server_name torbatyar.ir www.torbatyar.ir api.torbatyar.ir identity.torbatyar.ir auth.torbatyar.ir;
|
|
|
|
location /.well-known/acme-challenge/ {
|
|
root /var/www/html;
|
|
}
|
|
|
|
location / {
|
|
return 301 https://$host$request_uri;
|
|
}
|
|
}
|
|
|
|
# Tenant subdomains stay on HTTP until wildcard cert exists
|
|
server {
|
|
listen 192.168.10.156:80;
|
|
server_name *.torbatyar.ir;
|
|
|
|
location /.well-known/acme-challenge/ {
|
|
root /var/www/html;
|
|
}
|
|
|
|
location / {
|
|
proxy_pass http://torbatyar_frontend;
|
|
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;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
proxy_read_timeout 600s;
|
|
proxy_send_timeout 600s;
|
|
client_max_body_size 50m;
|
|
}
|
|
}
|
|
|
|
server {
|
|
listen 192.168.10.156:443 ssl;
|
|
server_name torbatyar.ir www.torbatyar.ir;
|
|
|
|
ssl_certificate /etc/letsencrypt/live/torbatyar.ir/fullchain.pem;
|
|
ssl_certificate_key /etc/letsencrypt/live/torbatyar.ir/privkey.pem;
|
|
include /etc/letsencrypt/options-ssl-nginx.conf;
|
|
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
|
|
|
|
location / {
|
|
proxy_pass http://torbatyar_frontend;
|
|
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;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
proxy_read_timeout 600s;
|
|
proxy_send_timeout 600s;
|
|
client_max_body_size 50m;
|
|
}
|
|
}
|
|
|
|
server {
|
|
listen 192.168.10.156:443 ssl;
|
|
server_name api.torbatyar.ir;
|
|
|
|
ssl_certificate /etc/letsencrypt/live/torbatyar.ir/fullchain.pem;
|
|
ssl_certificate_key /etc/letsencrypt/live/torbatyar.ir/privkey.pem;
|
|
include /etc/letsencrypt/options-ssl-nginx.conf;
|
|
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
|
|
|
|
location / {
|
|
proxy_pass http://torbatyar_core;
|
|
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;
|
|
proxy_read_timeout 600s;
|
|
client_max_body_size 50m;
|
|
}
|
|
}
|
|
|
|
server {
|
|
listen 192.168.10.156:443 ssl;
|
|
server_name identity.torbatyar.ir;
|
|
|
|
ssl_certificate /etc/letsencrypt/live/torbatyar.ir/fullchain.pem;
|
|
ssl_certificate_key /etc/letsencrypt/live/torbatyar.ir/privkey.pem;
|
|
include /etc/letsencrypt/options-ssl-nginx.conf;
|
|
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
|
|
|
|
location / {
|
|
proxy_pass http://torbatyar_identity;
|
|
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;
|
|
proxy_read_timeout 600s;
|
|
client_max_body_size 20m;
|
|
}
|
|
}
|
|
|
|
server {
|
|
listen 192.168.10.156:443 ssl;
|
|
server_name auth.torbatyar.ir;
|
|
|
|
ssl_certificate /etc/letsencrypt/live/torbatyar.ir/fullchain.pem;
|
|
ssl_certificate_key /etc/letsencrypt/live/torbatyar.ir/privkey.pem;
|
|
include /etc/letsencrypt/options-ssl-nginx.conf;
|
|
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
|
|
|
|
location / {
|
|
proxy_pass http://torbatyar_keycloak;
|
|
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;
|
|
proxy_buffer_size 128k;
|
|
proxy_buffers 4 256k;
|
|
proxy_busy_buffers_size 256k;
|
|
proxy_read_timeout 600s;
|
|
client_max_body_size 20m;
|
|
}
|
|
}
|