Skip to content

feat: As a user, I want to let proxy-mirror plugin resolve the host, so that the DNS resolver in APISIX can be used. #7796

Description

@spacewander

Description

The proxy-mirror doesn't support brighter DNS resolution, as its feature is currently based on Nginx's directive, which uses Nginx's own DNS resolution.

As Nginx's own DNS resolution doesn't support modern DNS features, this brings some inconvenience, especially under k8s.

To solve the problem, we need to resolve the host ourselves, and pass the result to the Nginx variable upstream_mirror_uri.

ctx.var.upstream_mirror_uri =
conf.host .. (conf.path or ctx.var.uri) .. ctx.var.is_args .. (ctx.var.args or '')

We can use the method below to resolve the host:

function _M.parse_domain(host)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions