This app is a single Next.js application (one container). There is no separate backend or API gateway. The Next.js server handles:
- Pages and static assets:
/_next/static/*,/images/*, etc. - API routes:
/api/uploads/*,/api/properties/*,/api/developers/*,/api/health, and any other/api/*route defined insrc/pages/api/.
So all API routes are managed by our application — no external backend.
- Service registry is created/updated by
deploy-smart.sh(from nginx-microservice). It is stored innginx-microservice/service-registry/sgiprealestate.json; do not create or edit it in this repo. - Nginx config is generated from the registry. For a service with only a frontend (no
backend, noapi-gateway), the generator produces a single block:location /→ proxy to the frontend container (Next.js).
So every request (including /_next/static/chunks/*.js, /api/uploads/*, and all pages) goes to the same Next.js container. No nginx-api-routes.conf entries are required for that; listing routes is only needed when the service has a backend and you want specific paths to go to the frontend instead.
We have nginx/nginx-api-routes.conf with comments only (no route lines). That is intentional:
- With no routes listed, the registry is not given a
frontend_api_routesarray. - The generated nginx config still has only
location /→ frontend, so all traffic reaches Next.js.
If we added a route like /api/uploads, the current nginx generator would create a location that forwards only that path (not subpaths like /api/uploads/properties/images/xxx.webp), unless the generator supported prefix matching for that route. So we do not list routes here and rely on the single location / for the frontend-only setup.
Services that have both frontend and backend use nginx-api-routes.conf to list which /api/* paths must go to the frontend instead of the backend. Example: statex/nginx/nginx-api-routes.conf lists routes like /api/users/collect-contact, /api/notifications/prototype-request. Those get specific location blocks before the generic location /api/ block, so nginx sends those requests to the frontend and the rest of /api/* to the backend.
For sgiprealestate there is no backend, so no such split is needed.
If the browser receives HTML instead of JS or images (e.g. SyntaxError: Unexpected token '<', or images not loading), usually:
- Nginx is not proxying
/_next/*or/api/*to the Next.js container (e.g. a genericlocation /api/ortry_filesis sending requests elsewhere or serving HTML). - Or the registry on the server has a backend/api-gateway for this service, so a generic
location /api/was generated and points to a non-existent or wrong upstream.
Check on the server:
- Registry:
jq . nginx-microservice/service-registry/sgiprealestate.json— should have only afrontend(or single) service, nobackend/api-gateway. - Generated config:
grep -A5 "location /" nginx-microservice/nginx/conf.d/blue-green/sgipreal.com.*.conf— should showproxy_passto the sgiprealestate frontend forlocation /; notry_filesorrootthat could serve HTML for/_next/or/api/.
See POST_DEPLOY_VERIFICATION.md §4.1 (Browser check) for curl checks and steps.