diff --git a/ansible/roles/schulcloud-server-core/templates/api-files-ingress.yml.j2 b/ansible/roles/schulcloud-server-core/templates/api-files-ingress.yml.j2 index 79a856fb81b..41e4a301124 100644 --- a/ansible/roles/schulcloud-server-core/templates/api-files-ingress.yml.j2 +++ b/ansible/roles/schulcloud-server-core/templates/api-files-ingress.yml.j2 @@ -17,6 +17,14 @@ metadata: nginx.ingress.kubernetes.io/server-snippet: | client_header_buffer_size 100k; large_client_header_buffers 4 100k; +{% if KEDA_NAMESPACE_ACTIVATOR_ENABLED is defined %} + proxy_intercept_errors on; + error_page 503 = @errorpages; + + location @errorpages { + return 302 'https://activate.cd.dbildungscloud.dev/namespace?namespace={{ NAMESPACE }}&redirected-from-503=true'; + } +{% endif %} {% if CLUSTER_ISSUER is defined %} cert-manager.io/cluster-issuer: {{ CLUSTER_ISSUER }} {% endif %} diff --git a/ansible/roles/schulcloud-server-core/templates/api-fwu-ingress.yml.j2 b/ansible/roles/schulcloud-server-core/templates/api-fwu-ingress.yml.j2 index d1e32d4c4bd..411c365bdd8 100644 --- a/ansible/roles/schulcloud-server-core/templates/api-fwu-ingress.yml.j2 +++ b/ansible/roles/schulcloud-server-core/templates/api-fwu-ingress.yml.j2 @@ -17,6 +17,14 @@ metadata: nginx.ingress.kubernetes.io/server-snippet: | client_header_buffer_size 100k; large_client_header_buffers 4 100k; +{% if KEDA_NAMESPACE_ACTIVATOR_ENABLED is defined %} + proxy_intercept_errors on; + error_page 503 = @errorpages; + + location @errorpages { + return 302 'https://activate.cd.dbildungscloud.dev/namespace?namespace={{ NAMESPACE }}&redirected-from-503=true'; + } +{% endif %} {% if CLUSTER_ISSUER is defined %} cert-manager.io/cluster-issuer: {{ CLUSTER_ISSUER }} {% endif %} diff --git a/ansible/roles/schulcloud-server-core/templates/ingress.yml.j2 b/ansible/roles/schulcloud-server-core/templates/ingress.yml.j2 index 71f963b1caa..eb6951c3c92 100644 --- a/ansible/roles/schulcloud-server-core/templates/ingress.yml.j2 +++ b/ansible/roles/schulcloud-server-core/templates/ingress.yml.j2 @@ -17,6 +17,14 @@ metadata: nginx.ingress.kubernetes.io/server-snippet: | client_header_buffer_size 100k; large_client_header_buffers 4 100k; +{% if KEDA_NAMESPACE_ACTIVATOR_ENABLED is defined %} + proxy_intercept_errors on; + error_page 503 = @errorpages; + + location @errorpages { + return 302 'https://activate.cd.dbildungscloud.dev/namespace?namespace={{ NAMESPACE }}&redirected-from-503=true'; + } +{% endif %} {% if CLUSTER_ISSUER is defined %} cert-manager.io/cluster-issuer: {{ CLUSTER_ISSUER }} {% endif %} diff --git a/ansible/roles/schulcloud-server-h5p/templates/api-h5p-ingress.yml.j2 b/ansible/roles/schulcloud-server-h5p/templates/api-h5p-ingress.yml.j2 index b6118efc7ea..8b472c3e26d 100644 --- a/ansible/roles/schulcloud-server-h5p/templates/api-h5p-ingress.yml.j2 +++ b/ansible/roles/schulcloud-server-h5p/templates/api-h5p-ingress.yml.j2 @@ -17,6 +17,14 @@ metadata: nginx.ingress.kubernetes.io/server-snippet: | client_header_buffer_size 100k; large_client_header_buffers 4 100k; +{% if KEDA_NAMESPACE_ACTIVATOR_ENABLED is defined %} + proxy_intercept_errors on; + error_page 503 = @errorpages; + + location @errorpages { + return 302 'https://activate.cd.dbildungscloud.dev/namespace?namespace={{ NAMESPACE }}&redirected-from-503=true'; + } +{% endif %} {% if CLUSTER_ISSUER is defined %} cert-manager.io/cluster-issuer: {{ CLUSTER_ISSUER }} {% endif %}