Read more

nginx: How to drop connections for a location

Arne Hartherz
March 02, 2016Software engineer at makandra GmbH

If you want to configure your nginx to drop connections to a specific location, you can do so by responding with HTTP response code 444.

Illustration web development

Do you need DevOps-experts?

Your development team has a full backlog? No time for infrastructure architecture? Our DevOps team is ready to support you!

  • We build reliable cloud solutions with Infrastructure as code
  • We are experts in security, Linux and databases
  • We support your dev team to perform
Read more Show archive.org snapshot

Status 444 is a non-standard response code that nginx will interpret as "drop connection".

Example:

server {
  listen 127.0.0.1;
  
  location /api/ {
    return 444;
  }
}

An example use case is reverse-proxying with nginx and simulating a route that drops connections.

Posted by Arne Hartherz to makandra dev (2016-03-02 14:25)