Enable the JWT auth plugin

Add the jwt-auth plugin to an existing route through the 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
tags
apisixapi-gatewayjwtauth

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 their URI and upstream nodes.

  • curl -s http://apisix:9180/apisix/admin/routes/<id> -H 'X-API-KEY: <key>' | jq .

    Show the full configuration of one APISIX route.

  • curl -s http://apisix:9180/apisix/admin/upstreams -H 'X-API-KEY: <key>' | jq '.list[].value | {id:.id, nodes:.nodes}'

    List all APISIX upstreams with their nodes.

  • curl -s http://apisix:9180/apisix/admin/plugins/list -H 'X-API-KEY: <key>' | jq .

    List all available APISIX plugins.

  • curl -X PUT http://apisix:9180/apisix/admin/configs/reload -H 'X-API-KEY: <key>'

    Reload APISIX configuration from etcd without a restart.

all 16 apisix commands