如题
我用openresty作openapi来使用,解析,路由,反向代理。
原来的访问地址是这样的模式:
local res = ngx.location.capture(proxy_path, {
method = ngx.HTTP_POST,
body = body
});
其中proxy_path的定义是这样的:
local proxy_path = "/proxy/http/192.168.1.50/19080/api/postapi"
升级到openresty/1.15.8.2后,上面的地址好像访问不通了,日志显示如下:
2020/08/26 10:39:20 [error] 29759#0: *9 open() "/usr/local/openresty/nginx/html/proxy/http/192.168.1.50/19080/api/postapi" failed (2: No such file or directory), client: xx.xx.xx.xx, server: yy.domainname.org, request: "POST /api HTTP/1.1", subrequest: ""/proxy/http/192.168.1.50/19080/api/postapi", host: "yy.domainname.org"
请问更新到新版本的openresty后,这个代理地址 local proxy_path = "/proxy/http/192.168.1.50/19080/api/postapi" 是不是需要修改?
我也尝试了直接的URL,
local proxy_path = 'http://192.168.1.50:19080/api/postapi'
获得错误如下:
2020/08/26 12:01:30 [error] 1428#0: *1772 open() "/usr/local/openresty/nginx/htmlhttp://192.168.1.50:19080/api/postapi" failed (2: No such file or directory), client: yy.domainname.org, server: dev.cpsdna.org, request: "POST /api HTTP/1.1", subrequest: "http://192.168.1.50:19080/api/postapi", host: "yy.domainname.org"
请问我应该如何修改代理地址,能正常的使用。
期待回复,没有找到相应的更新信息。