Version: 2.1.0
referer-restriction
Summary#
Name#
The referer-restriction can restrict access to a Service or a Route by
whitelisting request header Referrers.
Attributes#
| Name | Type | Requirement | Default | Valid | Description |
|---|---|---|---|---|---|
| whitelist | array[string] | required | List of hostname to whitelist. The hostname can be started with * as a wildcard | ||
| bypass_missing | boolean | optional | false | Whether to bypass the check when the Referer header is missing or malformed |
How To Enable#
Creates a route or service object, and enable plugin referer-restriction.
Test Plugin#
Request with Referer: http://xx.com/x:
Request with Referer: http://yy.com/x:
Request without Referer:
Disable Plugin#
When you want to disable the referer-restriction plugin, it is very simple,
you can delete the corresponding json configuration in the plugin configuration,
no need to restart the service, it will take effect immediately:
The referer-restriction plugin has been disabled now. It works for other plugins.