-
Notifications
You must be signed in to change notification settings - Fork 2k
Lua supports hosts #2385
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Because So back to your question, |
Actually, it is not as easy as you think to support |
Thank you for your reply, it is very helpful for me. I will take some time to understand this. |
When using connect, static resolution is not supported, only resolver is supported.It's forbidden here,https://github.com/ZJfans/lua-nginx-module/blob/master/src/ngx_http_lua_socket_tcp.c#L668 .
I studied the code and official documentation, https://www.f5.com/company/blog/nginx/dns-service-discovery-nginx-plus ,All modules set no_resolve to 1, which prohibits domain name resolution. I guess it is to prevent repeated resolution. It is only processed in https://github.com/nginx/nginx/blob/master/src/http/ngx_http_upstream_round_robin.c#L366 .
This is enough for nginx, but when I use openresty and use domain names from lua, I have to configure the resolver because hosts (which actually also includes the system's dns) are not supported. Currently I have introduced the dns module of kong, https://github.com/Kong/kong/tree/master/kong/resty/dns ,for hosts.
I'm not sure if I understand correctly, should we support hosts. it would only require a small change.
@zhuizhuhaomeng I'd appreciate it if you have time to look at this.
The text was updated successfully, but these errors were encountered: