# Include this inside each public server {} that proxies to internal AWOOOI,
# StockPlatform, MOMO, Tsenyang, Bitan, Gitea, Harbor, or registry upstreams.
#
# The static file must be deployed outside the application containers, for
# example /var/www/maintenance/maintenance.html on the edge Nginx host.

proxy_intercept_errors on;
error_page 502 503 504 /__awoooi-maintenance.html;

location = /__awoooi-maintenance.html {
    internal;
    root /var/www/maintenance;
    try_files /maintenance.html =503;
    add_header Cache-Control "no-store, no-cache, must-revalidate, max-age=0" always;
    add_header Retry-After "120" always;
    add_header X-AWOOOI-Fallback "local-maintenance" always;
}
