Skip to content

A Traefik plugin to block access to certain urls using a list of regex values and return a defined status code.

License

Notifications You must be signed in to change notification settings

blueshift-labs/traefik-block-regex-urls

Repository files navigation

Traefik Block Regex Urls

A Traefik plugin to block access to certain paths using a list of regex values and return a defined status code.

Configuration

Sample configuration in Traefik.

Configuration as local plugin

static.yml (development)

experimental:
  localPlugins:
    block-regex-urls:
      moduleName: 'github.com/blueshift-labs/traefik-block-regex-urls'

static.yml (production)

experimental:
  plugins:
    block-regex-urls:
      moduleName: 'github.com/blueshift-labs/traefik-block-regex-urls'
      version: 'v0.0.2'

dynamic-configuration.yml

http:
  middlewares:
    block-scan-paths:
      plugin:
        block-regex-urls:
          exact_match:
            - "some_exact_string_with_regex_chars_?/._to_block"
          regex:
            - "^something.mydomain.tld\\/scan\\?uid=12345(.*)&gid=6789(.*)"
            - "^something.mydomain.tld\\/scan\\?uid=345$"
          statusCode: 404

About

A Traefik plugin to block access to certain urls using a list of regex values and return a defined status code.

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages