Maintenance Mode
Goma Gateway provides a maintenance mode feature that allows you to temporarily block access to your backend services. This is useful during:
- Planned maintenance windows
- Service upgrades or deployments
- Emergency downtime or troubleshooting
Maintenance mode is set per route. When it is enabled, Goma Gateway answers every request on that route with a configurable HTTP status code and message instead of forwarding it to the backend. The check runs before the route's middlewares, so no authentication or other middleware is evaluated.
Configuration Fields
-
enabled(boolean, default:false) Whether maintenance mode is active.true→ Maintenance mode enabled (all requests blocked).false→ Maintenance mode disabled (requests routed normally).
-
statusCode(integer, optional, default:503) The HTTP status code returned when maintenance mode is active.-
Common values:
503→ Service Unavailable (default)500→ Internal Server Error404→ Not Found (useful if you want the service to appear absent)
-
-
message(string, optional) The response body to send when maintenance mode is active.- Defaults to:
"503 Service temporarily unavailable". - The response format is chosen from the request's
Acceptheader (orContent-TypewhenAcceptis absent): a value of exactlyapplication/jsonreturns{"success": false, "statusCode": ..., "error": "<message>"}(or the message itself if it is valid JSON),application/xmlortext/xmlreturns an XML document, and anything else returns plain text.
- Defaults to:
Example: Maintenance Mode Configuration
gateway:
routes:
- name: api-example
path: /
target: http://api-example:8080
maintenance:
enabled: true
statusCode: 503
message: "503 Service Unavailable"
Maintenance mode is part of the route configuration, so it can be switched on and off with a configuration reload, without restarting the gateway.