referer-restriction

IMPORTANT

Only one of whitelist or blacklist attribute must be specified. They cannot work together.

Once you have configured the Plugin as shown above, you can test it by setting Referer: http://xx.com/x:

    1. curl http://127.0.0.1:9080/index.html -H 'Referer: http://yy.com/x'

    Since we have set bypass_missing to true a request without the Referer header will be successful as the check is skipped:

    1. curl http://127.0.0.1:9080/index.html
    1. curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
    2. "uri": "/index.html",
    3. "plugins": {},
    4. "type": "roundrobin",
    5. "nodes": {
    6. "127.0.0.1:1980": 1
    7. }
    8. }