diff --git a/examples/configuration/echo.json b/examples/configuration/echo.json index f1ee8cee6..b9e599487 100644 --- a/examples/configuration/echo.json +++ b/examples/configuration/echo.json @@ -15,8 +15,7 @@ "host": "echo" }, "policy_chain": [ - { "name": "apicast.policy.echo" }, - { "name": "apicast.policy.apicast" } + { "name": "apicast" } ], "proxy_rules": [ { diff --git a/gateway/src/apicast/policy/echo.lua b/gateway/src/apicast/policy/echo.lua index c31d323fc..f114f5852 100644 --- a/gateway/src/apicast/policy/echo.lua +++ b/gateway/src/apicast/policy/echo.lua @@ -1,8 +1,9 @@ local policy = require('apicast.policy') local _M = policy.new('Echo Policy') -function _M.access() - ngx.log(ngx.DEBUG, ngx.var.request) +function _M.rewrite() + ngx.say(ngx.var.request) + ngx.exit(0) end return _M