????????当你通过admin api 接口方式执行相关操作时,例如route、upstream设置,接口返回403 Forbidden,
例如 请求
curl -i "http://192.168.100.1:9180/apisix/admin/routes" -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
{
? "id": "getting-started-headers",
? "uri": "/headers",
? "upstream" : {
? ? "type": "roundrobin",
? ? "nodes": {
? ? ? "httpbin.org:443": 1,
? ? ? "mock.api7.ai:443": 1
? ? },
? ? "pass_host": "node",
? ? "scheme": "https"
? }
}'
返回结果:
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<center>
<h1>403 Forbidden</h1>
</center>
<hr>
<center>openresty</center>
<p><em>Powered by <a href="https://apisix.apache.org/">APISIX</a>.</em></p>
</body>
</html>
????????造成403 Forbidden的原因是,apisix处于安全考虑,默认只允许apisix本机访问调用api