Repository navigation
feature: ngx.get_phase(): add the server_name_resolver phase. - #549
Draft
climagabriel wants to merge 1 commit into
Draft
climagabriel wants to merge 1 commit into
climagabriel wants to merge 1 commit into
Conversation
This is the context of the server_name_resolver_by_lua_block directive of lua-nginx-module, NGX_HTTP_LUA_CONTEXT_SERVER_NAME_RESOLVER (0x00080000).
This was referenced Nov 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the phase name
server_name_resolvertongx.get_phase(), for the contextNGX_HTTP_LUA_CONTEXT_SERVER_NAME_RESOLVERthat openresty/lua-nginx-module#2548 (lua-nginx-module) adds forserver_name_resolver_by_lua_block. openresty/lua-nginx-module#2548 depends on an nginx core change, nginx/nginx#1972. Neither is merged; this one should not merge first.The change is one entry in
lib/resty/core/phase.luaand one test, TEST 2 int/phase.t. The value, 0x00080000, must match openresty/lua-nginx-module#2548.Without the entry,
ngx.get_phase()in the directive's chunk raisesunknown phase: 524288(0x00080000).Testing, on plain nginx 1.31.8 (not an OpenResty release); only
t/phase.twas run:t/phase.tpasses, TEST 2 included.skip_evalwhen the nginx binary does not contain the stringserver_name_resolver_by_lua_block, or contains the messagerequires nginx with the server_name_resolver hook, which feature: add the server_name_resolver_by_lua_block directive. lua-nginx-module#2548 compiles in only when the nginx core lacks the callback. Checked on two builds: feature: add the server_name_resolver_by_lua_block directive. lua-nginx-module#2548 without HTTP: added a server name resolver hook for modules nginx/nginx#1972, and lua-nginx-module master without either. Both skip TEST 2 and pass.I hereby granted the copyright of the changes in this pull request
to the authors of this lua-resty-core project.