# OMNL Bank — production domain routing
# Deploy: scripts/deployment/deploy-omnl-domains.sh
# Origin: dev-bis-ali (76.53.10.34) — point DNS A records here (or Cloudflare proxy)

upstream omnl_frontend {
    server 127.0.0.1:3002;
}

upstream omnl_api {
    server 127.0.0.1:3000;
}

upstream omnl_settlement {
    server 127.0.0.1:3011;
}

upstream omnl_exchange {
    server 127.0.0.1:3012;
}

# DBIS Trade — exchange.omdnl.org + exchange.d-bis.org
server {
    listen 80;
    listen [::]:80;
    server_name exchange.omdnl.org exchange.d-bis.org;

    add_header X-OMNL-Product "dbis-trade" always;
    add_header X-OMNL-Chains "128" always;

    location = / {
        return 302 /trade;
    }

    include /etc/nginx/snippets/omnl-common-locations.conf;
}

# Central Bank secure dashboard — secure.omdnl.org + secure.d-bis.org
server {
    listen 80;
    listen [::]:80;
    server_name secure.omdnl.org secure.d-bis.org;

    add_header X-OMNL-Product "central-bank" always;
    add_header X-OMNL-Chains "128" always;

    location = / {
        return 302 /central-bank;
    }

    include /etc/nginx/snippets/omnl-common-locations.conf;
}

# OMNL online banking hub — online.omdnl.org
server {
    listen 80;
    listen [::]:80;
    server_name online.omdnl.org;

    add_header X-OMNL-Product "online-banking" always;
    add_header X-OMNL-Chains "128" always;

    location = / {
        return 302 /central-bank;
    }

    include /etc/nginx/snippets/omnl-common-locations.conf;
}

# Forex terminal — forex.omdnl.org + forex.d-bis.org
server {
    listen 80;
    listen [::]:80;
    server_name forex.omdnl.org forex.d-bis.org;

    add_header X-OMNL-Product "forex-trade" always;
    add_header X-OMNL-Chains "128" always;

    location = / {
        return 302 /trade;
    }

    include /etc/nginx/snippets/omnl-common-locations.conf;
}

# Digital assets / swap — digital.omdnl.org
server {
    listen 80;
    listen [::]:80;
    server_name digital.omdnl.org;

    add_header X-OMNL-Product "digital-swap" always;
    add_header X-OMNL-Chains "128" always;

    location = / {
        return 302 /swap;
    }

    include /etc/nginx/snippets/omnl-common-locations.conf;
}

# Office 24 settlement — office24.omdnl.org
server {
    listen 80;
    listen [::]:80;
    server_name office24.omdnl.org;

    add_header X-OMNL-Product "office-24" always;
    add_header X-OMNL-Chains "128" always;

    location = / {
        return 302 /office-24;
    }

    include /etc/nginx/snippets/omnl-common-locations.conf;
}
