Steadybit logoResilience Hub
Try SteadybitGitHub icon
Steadybit logoResilience Hub

Block Traffic to a Backend

AttackAttack
Block traffic to a backend
Targets:
Kubernetes NGINX Ingresses
Install now

Block Traffic to a Backend

Block traffic to a backend
AttackAttack
Install now

Block Traffic to a Backend

AttackAttack
Block traffic to a backend
Targets:
Kubernetes NGINX Ingresses
Install now

Block Traffic to a Backend

Block traffic to a backend
AttackAttack
Install now
Go back to list

Introduction

You can use the nginx ingress block traffic action to block all traffic to a specific HTTP path / HTTP Method / HTTP Headers in the ingress controller by returning a specific HTTP status code. This is useful for testing how your application behaves when specific endpoints are not reachable.

Requirements

Important: Snippets must be enabled on your NGINX Ingress Controller. This can be done by:

  • Adding --enable-snippets to the controller arguments
  • Or setting the enable-snippets ConfigMap option to true
  • Or for NGINX Ingress Operator: kubectl patch NginxIngress nginxingress-controller -n nginx-ingress --type=merge -p '{"spec":{"controller":{"enableSnippets":true}}}'

Use Cases

  • Test application resilience when specific endpoints are unavailable
  • Simulate partial service outages
  • Block specific clients identified by HTTP headers

Usage

You can not apply the nginx delay and block actions to the same ingress resource at the same time.

Rollback

The annotation made to the ingress resource will be removed automatically after the action is finished. If you want to rollback manually, you can look for the annotation nginx.ingress.kubernetes.io/configuration-snippet (or nginx.org/server-snippets for Enterprise NGINX) in the ingress resource and remove the parts that are surrounded by # BEGIN STEADYBIT - and # END STEADYBIT -. The steadybit parts in the annotation will be removed automatically after the action is finished.

Parameters

Path Pattern, HTTP Method, and HTTP Headers are optional parameters. If you do not set them, nothing will be blocked. If you set them, all requests that match the path pattern, HTTP method, and HTTP headers will be blocked.

NameRequiredDescription
DurationtrueHow long should the traffic be affected?
Status CodetrueThe status code which should get returned (100-999).
Path PatternfalseA regex pattern to match the paths to block.
HTTP MethodfalseA http method to match the requests to block. * is used as not set.
HTTP HeadersfalseA list of HTTP headers to match the requests to block. Value is a regex pattern. If multiple headers are set, all of them must match.

More Kubernetes NGINX Ingress Actions

See all
Delay traffic to a backend
Delay traffic to a backend
AttackAttack
Kubernetes NGINX Ingresses
Start Using Steadybit Today

Get started with Steadybit, and you’ll get access to all of our features to discover the full power of Steadybit. Available for SaaS and on-prem!

Are you unsure where to begin?

No worries, our reliability experts are here to help: book a demo with them!

Statistics
-Stars
Tags
Kubernetes
Block traffic
Ingress
NGINX
Homepage
hub.steadybit.com/extension/com.steadybit.extension_kubernetes
License
MIT
MaintainerSteadybit
Install now
Steadybit logoResilience Hub
Try Steadybit
© 2025 Steadybit GmbH. All rights reserved.
Twitter iconLinkedIn iconGitHub icon