Skip to content

block

block rejects matching HTTP methods or paths with 403 Forbidden.

yaml
server:
  http:
    middlewares:
      deny_writes:
        block:
          methods:
            - POST
            - PUT
            - DELETE
          regex_path: ^/admin/.*$
FieldDescription
methodsHTTP methods to block. Matching is case-insensitive after methods are uppercased.
regex_pathOptional Go regular expression. Matching paths are blocked.

Requests that do not match continue to the next middleware.