Enable JWT auth plugin
Add jwt-auth plugin to an existing route via Admin API
curl -X PATCH http://apisix-admin:9180/apisix/admin/routes/1 \
-H "X-API-KEY: $ADMIN_KEY" \
-d '{"plugins":{"jwt-auth":{"header":"Authorization","query":"jwt"}}}'
- tool
- apisix16 commands
More apisix commands
-
curl -s http://apisix:9180/apisix/admin/routes -H 'X-API-KEY: <key>' | jq '.list[].value | {id:.id, uri:.uri, upstream:.upstream.nodes}'List all APISIX routes with URI and upstream
-
curl -s http://apisix:9180/apisix/admin/routes/<id> -H 'X-API-KEY: <key>' | jq .Inspect a single APISIX route configuration
-
curl -s http://apisix:9180/apisix/admin/upstreams -H 'X-API-KEY: <key>' | jq '.list[].value | {id:.id, nodes:.nodes}'All APISIX upstream definitions with nodes
-
curl -s http://apisix:9180/apisix/admin/plugins/list -H 'X-API-KEY: <key>' | jq .All available APISIX plugins
-
curl -X PUT http://apisix:9180/apisix/admin/configs/reload -H 'X-API-KEY: <key>'Hot-reload APISIX configuration from etcd