diff --git a/agent/templates/nginx.conf.ejs b/agent/templates/nginx.conf.ejs index 5238054c..c57395a5 100644 --- a/agent/templates/nginx.conf.ejs +++ b/agent/templates/nginx.conf.ejs @@ -90,6 +90,7 @@ http { location /403.html { } location /404.html { } location /502.html { } + location /504.html { } location /auth-unavailable.html { } } @@ -141,6 +142,17 @@ http { proxy_pass http://error_pages; } + <%_ /* A frozen/paused or OOMing-but-alive upstream keeps the socket open + but never replies, so NGINX hits proxy_read_timeout and returns 504. */ -%> + error_page 504 @504; + location @504 { + rewrite ^ /504.html break; + proxy_method GET; + proxy_pass_request_body off; + proxy_set_header Content-Length ""; + proxy_pass http://error_pages; + } + <%_ if (httpServices.length === 0) { _%> location / { proxy_pass http://localhost:3000; @@ -210,6 +222,17 @@ http { proxy_pass http://error_pages; } + <%_ /* A frozen/paused or OOMing-but-alive upstream keeps the socket open + but never replies, so NGINX hits proxy_read_timeout and returns 504. */ -%> + error_page 504 @504; + location @504 { + rewrite ^ /504.html break; + proxy_method GET; + proxy_pass_request_body off; + proxy_set_header Content-Length ""; + proxy_pass http://error_pages; + } + <%_ if (authRequired && authServer) { _%> <%_ /* oauth2-proxy runs on its own address (this domain's "oauth2-proxy URL"). @@ -394,6 +417,17 @@ http { proxy_pass http://error_pages; } + <%_ /* A frozen/paused or OOMing-but-alive upstream keeps the socket open + but never replies, so NGINX hits proxy_read_timeout and returns 504. */ -%> + error_page 504 @504; + location @504 { + rewrite ^ /504.html break; + proxy_method GET; + proxy_pass_request_body off; + proxy_set_header Content-Length ""; + proxy_pass http://error_pages; + } + <%_ /* Serve documentation site statically */ -%> location / { root /opt/opensource-server/mie-opensource-landing/site; diff --git a/error-pages/502.html b/error-pages/502.html index 547c52b9..0a12bccd 100644 --- a/error-pages/502.html +++ b/error-pages/502.html @@ -130,7 +130,8 @@
502

Service Unavailable

- A service is configured for this hostname, but the upstream is not responding. + A service is configured for this hostname, but the upstream refused the + connection. The service is likely stopped or has crashed.

diff --git a/error-pages/504.html b/error-pages/504.html new file mode 100644 index 00000000..5e4014c8 --- /dev/null +++ b/error-pages/504.html @@ -0,0 +1,151 @@ + + + + + + 504 — Service Paused + + + +
+
504
+

Service Paused

+

+ This service accepted the connection but did not respond in time. It is + likely paused or under heavy load — it should come back on its own shortly. +

+
+
+

What's happening?

+
    +
  • Wait a few moments and reload — the service may just be temporarily paused or busy.
  • +
  • The container may be under memory pressure; the host can pause it to protect other services on the same machine.
  • +
  • If you're in charge of this service, check its memory usage and look for a request that may be taking too long to complete.
  • +
  • Requests that exceed the proxy timeouts (for example, proxy_read_timeout) can end with this error.
  • +
+
+
+ + +