English
Infrastructure and Domain Planning
This is the first stage of the Complete Go-Live Guide: getting the system to serve traffic with production configuration. It covers how domains are split, who owns certificates, which environment variables stop the startup when missing, and which gateway interfaces to open. Deployment operations themselves live in the deployment docs — this page is about decisions and checks.
Local integration setups (tunneling, self-signed certificates) are out of scope here — see Local Debugging.
Domain Planning
The system exposes five mandatory domains, each carrying a different role. Plan them separately (they may share one server, but do not share a domain); there is also one optional mobile API domain for mini programs / apps that need a dedicated access line:
| Domain | Serves | Audience | HTTPS |
|---|---|---|---|
| Admin portal domain | Web admin panel (operations side) | Internal operations staff | Required |
| Merchant portal domain | Web merchant panel | Merchants | Required |
| Payment gateway domain (H5) | Cashier / aggregate scan / auth relay pages | Payers | Required (payer-facing pages over HTTP are rejected by browsers and by WeChat / Alipay) |
| Backend API domain | unipay open API + channel callback entry | Merchant business systems, WeChat / Alipay servers | Required |
| Artemis console domain | Message queue console | Internal operations | Required (do not put it behind a CDN) |
| Mobile API domain (optional) | Session APIs for mini programs / apps + dedicated entry for the cashier open API | Admin / merchant mini programs and apps | Required (mini programs only accept HTTPS domains) |
Four decision points:
- Domains must pass ICP filing: WeChat / Alipay validate filing status and ownership when you configure payment directories, authorized domains, and QR code rules; an unfiled domain cannot pass channel-side configuration.
- The five mandatory domains map one-to-one to the backend "Endpoint Configuration" (see Platform Initialization - Endpoint Configuration). A mismatch between the deployed domain and the endpoint configuration is the most common cause of post-launch 404 redirects and callback failures.
- The mobile API domain is an optional isolation upgrade: without it, mini programs and apps work normally through the backend API domain (see Gateway Open Access Interfaces below); bind it when you need to separate your own clients from third-party integration and expose sign-in endpoints only through a dedicated domain. It does not correspond to any endpoint configuration item — registering either domain as the mini-program legal domain is enough.
- The one-click installer panel generates gateway routes from each domain's binding target (Gateway Management - Domain Binding and CDN Fronting); static source deployment means planning them yourself in nginx, with an example in Project Build - Static Deployment.
Choosing a Deployment Path
| Path | Fits | Requirements |
|---|---|---|
| One-click deployment (operations panel) | Most production deployments: single-machine Docker, with the panel managing gateway / certificates / upgrades | x86_64 Linux, ≥8 GB memory, root, network access to pull images |
| Source build + static deployment | Custom nginx / self-managed K8s, or offline trimming | Your own JDK / Node / middleware and nginx configuration skills |
The application configuration items of both paths are identical (see Configuration); the only difference is how certificates and the gateway are hosted:
- Certificate ownership in one-click deployment: the gateway origin is certificate-free and always speaks HTTP; HTTPS is terminated by the outer CDN / gateway, with certificate issuance, renewal, and validation all done in the outer console — the panel does not manage certificates. Production favors the "via CDN origin-pull" mode (including the origin-pull token).
- Certificate ownership in static deployment: certificates live in your own nginx layer; the payer-facing H5 domain must have one.
Middleware Production Requirements
Production requirements for the three middleware components — PostgreSQL, Redis, and Artemis (one-click deployment already ships this way; check item by item on a self-built setup):
- Credentials: replace all default / empty passwords (in one-click deployment, use "Change Password" on the corresponding service card on the panel's "Base Environment" page); Artemis ships with an empty password by default and must be set for production.
- Resources: see Panel Configuration - Memory Tiers for sizing (compact ≥4 GB / standard ≥8 GB recommended / enhanced ≥16 GB).
- Reachability: middleware and business container ports are not mapped to the host by default (port exposure off) — keep the default. For debugging, temporarily switch to
local(bound to 127.0.0.1); do not switch topublic.
Production Environment Variables
Source / static deployments read environment variables from the placeholders in application-prod.yml; one-click deployment maintains the equivalent items through the "Runtime Config" entry on the environment-mode bar at the top of the panel's "Business Environment" page. A missing required variable fails startup outright (fail-fast), so a gap surfaces at boot instead of being discovered at runtime.
The variables fall into several groups; the full list is in Configuration - Production Environment Variables:
| Group | Key items | Notes |
|---|---|---|
| Deployment mode | DEPLOY_MODE=PROD | See Switching to Production Mode below |
| Database | DB_USERNAME / DB_PASSWORD (required) | PostgreSQL credentials |
| Redis | REDIS_PASSWORD (required) | — |
| Message queue | ARTEMIS_USER / ARTEMIS_PASSWORD | Empty by default; must be set in production |
| Business keys | RSA_PRIVATE_KEY / RSA_PUBLIC_KEY / ENCRYPT_KEY (32 characters, required) | Platform-level signing and data encryption keys |
| Channel sub-apps | CHANNEL_*_TRANSPORT_KEY (required) | Transport keys between the main app and the channel sub-apps; startup fails without them |
| IP database | IP2REGION_* | Required by risk-control region blocking; the path and version must match the actual xdb file |
| Transactions | TRADE_SYNC_ENABLED=true | Transaction sync job; recommended on in production |
Do not regenerate business keys
RSA / AES / channel transport keys are generated and fixed on the first deployment. Regenerating them makes already-encrypted data undecryptable (channel key ciphertext, sensitive configuration, etc.) — never run "regenerate" in production.
Gateway Open Access Interfaces
The gateway of a one-click deployment admits external requests by path prefix under "External Endpoints" and rejects anything not admitted (Panel Gateway - External Endpoints). Default state and go-live checks per interface group:
| Interface | Purpose | Default | Notes |
|---|---|---|---|
/unipay | Merchant business systems call the open API | On | Must stay on while any merchant integrates via API |
/unipay/callback | WeChat / Alipay and other channels call back into the platform | On | Must stay on while using Alipay / WeChat channels |
/app-* (mini program / APP API) | Session APIs for the admin / merchant mini programs and apps | On | The lifeline of mini programs / apps — see below |
/client/ | Open access interfaces: anonymous or signed endpoints that external clients without their own frontend container (payment devices / terminals) call directly on the gateway | On | Turning it off breaks QR code payment and device terminal access |
/epay | EasyPay-compatible API | Off | Turn on when integrating over the EasyPay protocol (see Optional Features) |
/admin/, /mch/, /swagger-ui/, etc. | Web APIs of the admin and merchant panels | Always blocked | Management traffic is carried by the /api/ forward on the frontend domains; /demo/ and /test/ stay blocked |
Mini program / APP access routes (the status line at the bottom of the toggle card shows the route currently in effect):
- Compatible route (default): leave the API base URL empty when building the mini program (the backend API domain is used) and keep the
/app-*toggle on — works out of the box; do not turn it off casually; - Dedicated route (requires a sixth domain): bind the mobile API domain and enter it when building the mini program; that domain is always admitted and unaffected by the toggle. Once every existing mini program / app has switched over, turning
/app-*off is recommended so sign-in endpoints are only exposed through the dedicated domain; - Broken route:
/app-*off and no mobile API domain bound means mini programs cannot sign in (the panel asks for confirmation before turning it off). Direct access by IP never opens the session APIs (sign-in endpoints are protected against brute force).
Cost of closing /unipay: every API call from merchant systems is rejected by the gateway (404 / access denied). Cost of closing /unipay/callback: channel callbacks cannot get in, every order stays pending payment, and the only fallback is a manual "Sync" to pull the status. When "no interface works" right after go-live, check here first.
Static source deployment has no such toggle layer — the equivalent control lives in your own nginx routes. Make sure not to expose /demo/, /test/, or swagger to the public internet.
Switching to Production Mode
One-click deployment installs in DEV mode by default (sandbox and the development super admin are open, which eases integration). Switch before going live:
- In the "Runtime Config" entry on the environment-mode bar at the top of the panel's "Business Environment" page, switch the deployment mode to PROD. The system then forcibly disables the sandbox and the development super admin. Turning the sandbox on by hand under PROD is still caught by the startup check; the super administrator is a separate switch (off by default) that production can release through the panel after a second confirmation (writes
ALLOW_ADMIN_IN_PROD) — this only bypasses the single startup check for the super admin account, and all other production checks stay in force; - Restart the business containers to take effect (runtime configuration only needs a restart, no image rebuild — see Panel Configuration - How Changes Take Effect);
- Confirm that no sandbox entry appears in the UI after the restart (sandbox products are reset to production automatically; see Payment Capability - Product Environment).
DEV mode is not for production
The development super admin account (fixed weak password) can sign in to the admin panel in DEV mode, and sandbox products are visible. A deployment exposed to the internet must not stay in DEV mode.
For source deployment the equivalent is the startup parameter --spring.profiles.active=prod, with the same effect.
Gateway-Side Reservation for Domain Verification Files
WeChat / Alipay domain ownership verification fetches a verification file from the domain root and from the /m/, /cm/, and /am/ directories (upload entries are in Payment Capability - Domain Verification):
- One-click deployment: the H5 image already embeds the nginx reverse-proxy rules and forwards verification-file requests to the backend for a response. Existing deployments must upgrade the panel and rebuild the H5 container for this to take effect;
- Static deployment: configure the reverse proxy for the verification-file paths yourself in nginx (regex location, and it must sit before the SPA fallback
try_files). For a sample configuration see Project Build - Static Deployment; the cost of missing it is that domain verification on the channel / platform side never passes.
Checklist for This Stage
Next stage: Platform Initialization.