-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Supporting wildcard subdomains #297
Comments
I know we discussed some of the functionality prior but both those issues are specifically titled as pertaining to paths and nothing turned up when searching for "wildcard" or "subdomains". I thought it best to create a separate issue specific for this use case which can be found by anyone looking. |
Nothing wrong with the issue. |
This feature is really important for me too! :) |
+1 |
An API's `public_dns` can now contain one '*' at the start or at the end of the string, and on a dot border (same rules as http://nginx.org/en/docs/http/server_names.html#wildcard_names). If so, it will get special treatment during the lookup and the resolver will try to match any given `Host` header against all wildcard public_dns. We keep things efficient by guaranteeing O(1) lookup for non wildcard public_dns. Only wildcard public_dns and paths will be O(n). Implements #297.
👍 |
Implemented. |
Just a heads up on this: 0.4 has been quietly released now so this is available. We would love to hear feedback about 0.4 and the new features if you want to try it out. Thanks! |
An API's `public_dns` can now contain one '*' at the start or at the end of the string, and on a dot border (same rules as http://nginx.org/en/docs/http/server_names.html#wildcard_names). If so, it will get special treatment during the lookup and the resolver will try to match any given `Host` header against all wildcard public_dns. We keep things efficient by guaranteeing O(1) lookup for non wildcard public_dns. Only wildcard public_dns and paths will be O(n). Implements Kong#297. Former-commit-id: e04a36e3ce2010c0b2d9ddcb52d49b97aed13a41
#### 1.7.0 (2019-10-14) ##### New features - utils.quote_arg will now optionally take an array of arguments and escape them all into a single string. - app.parse_args now accepts a 3rd parameter with a list of valid flags and aliases - app.script_name returns the name of the current script (previously a private function) ##### Changes - Documentation updates - utils.quit: exit message is no longer required, and closes the Lua state (on 5.2+). - utils.assert_arg and utils.assert_string: now return the validated value - pl.compat: now exports the jit and jit52 flags - pretty.write: now sorts the output for easier diffs #293 ##### Fixes - utils.raise changed the global on_error-level when passing in bad arguments - utils.writefile now checks and returns errors when writing - compat.execute now handles the Windows exitcode -1 properly - types.is_empty would return true on spaces always, indepedent of the parameter - types.to_bool will now compare case-insensitive for the extra passed strings - app.require_here will now properly handle an absolute base path - stringx.split will no longer append an empty match if the number of requested elements has already been reached #295 - path.common_prefix and path.relpath return the result in the original casing (only impacted Windows) #297 - dir.copyfile, dir.movefile, and dir.makepath create the new file/path with the requested casing, and no longer force lowercase (only impacted Windows) #297 - added a missing assertion on path.getmtime #291 - stringx.rpartition returned bad results on a not-found #299 #### 1.6.0 (2018-11-23) ##### New features - pl.compat now provides unpack as table.unpack on Lua 5.1 ##### Changes - utils.unpack is now documented and respects .n field of its argument. - tablex.deepcopy and tablex.deepcompare are now cycle aware (#262) - Installing through LuaRocks will now include the full rendered documentation ##### Fixes - Fixed seq.last returning nil instead of an empty list when given an empty iterator (#253). - pl.template now applies tostring when substituting values in templates, avoiding errors when they are not strings or numbers (#256). - Fixed pl.import_into not importing some Penlight modules (#268). - Fixed version number stuck at 1.5.2 (#260). - Fixed types.is_empty returning true on tables containing false key (#267). - Fixed test.assertraise throwing an error when passed an array with a function to call plus its arguments (#272). - Fixed test.assertraise not throwing an error when given function does not error but instead returns a string matching given error pattern. - Fixed placeholder expressions being evaluated with wrong precedence of binary and unary negation. - Fixed placeholder expressions being evaluated assuming wrong binary operator associativity (e.g. _1-(_2+_3) was evaluated as (_1-_2)+_3. - Fixed placeholder expressions being evaluated as if unary operators take precedence over power operator (e.g. (-_1)^_2) was evaluated as -(_1^2)). - Fixed vulnerable backtracking pattern in pl.stringx.strip (#275)
#### 1.7.0 (2019-10-14) ##### New features - utils.quote_arg will now optionally take an array of arguments and escape them all into a single string. - app.parse_args now accepts a 3rd parameter with a list of valid flags and aliases - app.script_name returns the name of the current script (previously a private function) ##### Changes - Documentation updates - utils.quit: exit message is no longer required, and closes the Lua state (on 5.2+). - utils.assert_arg and utils.assert_string: now return the validated value - pl.compat: now exports the jit and jit52 flags - pretty.write: now sorts the output for easier diffs #293 ##### Fixes - utils.raise changed the global on_error-level when passing in bad arguments - utils.writefile now checks and returns errors when writing - compat.execute now handles the Windows exitcode -1 properly - types.is_empty would return true on spaces always, indepedent of the parameter - types.to_bool will now compare case-insensitive for the extra passed strings - app.require_here will now properly handle an absolute base path - stringx.split will no longer append an empty match if the number of requested elements has already been reached #295 - path.common_prefix and path.relpath return the result in the original casing (only impacted Windows) #297 - dir.copyfile, dir.movefile, and dir.makepath create the new file/path with the requested casing, and no longer force lowercase (only impacted Windows) #297 - added a missing assertion on path.getmtime #291 - stringx.rpartition returned bad results on a not-found #299 #### 1.6.0 (2018-11-23) ##### New features - pl.compat now provides unpack as table.unpack on Lua 5.1 ##### Changes - utils.unpack is now documented and respects .n field of its argument. - tablex.deepcopy and tablex.deepcompare are now cycle aware (#262) - Installing through LuaRocks will now include the full rendered documentation ##### Fixes - Fixed seq.last returning nil instead of an empty list when given an empty iterator (#253). - pl.template now applies tostring when substituting values in templates, avoiding errors when they are not strings or numbers (#256). - Fixed pl.import_into not importing some Penlight modules (#268). - Fixed version number stuck at 1.5.2 (#260). - Fixed types.is_empty returning true on tables containing false key (#267). - Fixed test.assertraise throwing an error when passed an array with a function to call plus its arguments (#272). - Fixed test.assertraise not throwing an error when given function does not error but instead returns a string matching given error pattern. - Fixed placeholder expressions being evaluated with wrong precedence of binary and unary negation. - Fixed placeholder expressions being evaluated assuming wrong binary operator associativity (e.g. _1-(_2+_3) was evaluated as (_1-_2)+_3. - Fixed placeholder expressions being evaluated as if unary operators take precedence over power operator (e.g. (-_1)^_2) was evaluated as -(_1^2)). - Fixed vulnerable backtracking pattern in pl.stringx.strip (#275)
#### 1.7.0 (2019-10-14) ##### New features - utils.quote_arg will now optionally take an array of arguments and escape them all into a single string. - app.parse_args now accepts a 3rd parameter with a list of valid flags and aliases - app.script_name returns the name of the current script (previously a private function) ##### Changes - Documentation updates - utils.quit: exit message is no longer required, and closes the Lua state (on 5.2+). - utils.assert_arg and utils.assert_string: now return the validated value - pl.compat: now exports the jit and jit52 flags - pretty.write: now sorts the output for easier diffs #293 ##### Fixes - utils.raise changed the global on_error-level when passing in bad arguments - utils.writefile now checks and returns errors when writing - compat.execute now handles the Windows exitcode -1 properly - types.is_empty would return true on spaces always, indepedent of the parameter - types.to_bool will now compare case-insensitive for the extra passed strings - app.require_here will now properly handle an absolute base path - stringx.split will no longer append an empty match if the number of requested elements has already been reached #295 - path.common_prefix and path.relpath return the result in the original casing (only impacted Windows) #297 - dir.copyfile, dir.movefile, and dir.makepath create the new file/path with the requested casing, and no longer force lowercase (only impacted Windows) #297 - added a missing assertion on path.getmtime #291 - stringx.rpartition returned bad results on a not-found #299 #### 1.6.0 (2018-11-23) ##### New features - pl.compat now provides unpack as table.unpack on Lua 5.1 ##### Changes - utils.unpack is now documented and respects .n field of its argument. - tablex.deepcopy and tablex.deepcompare are now cycle aware (#262) - Installing through LuaRocks will now include the full rendered documentation ##### Fixes - Fixed seq.last returning nil instead of an empty list when given an empty iterator (#253). - pl.template now applies tostring when substituting values in templates, avoiding errors when they are not strings or numbers (#256). - Fixed pl.import_into not importing some Penlight modules (#268). - Fixed version number stuck at 1.5.2 (#260). - Fixed types.is_empty returning true on tables containing false key (#267). - Fixed test.assertraise throwing an error when passed an array with a function to call plus its arguments (#272). - Fixed test.assertraise not throwing an error when given function does not error but instead returns a string matching given error pattern. - Fixed placeholder expressions being evaluated with wrong precedence of binary and unary negation. - Fixed placeholder expressions being evaluated assuming wrong binary operator associativity (e.g. _1-(_2+_3) was evaluated as (_1-_2)+_3. - Fixed placeholder expressions being evaluated as if unary operators take precedence over power operator (e.g. (-_1)^_2) was evaluated as -(_1^2)). - Fixed vulnerable backtracking pattern in pl.stringx.strip (#275)
#### 1.7.0 (2019-10-14) ##### New features - utils.quote_arg will now optionally take an array of arguments and escape them all into a single string. - app.parse_args now accepts a 3rd parameter with a list of valid flags and aliases - app.script_name returns the name of the current script (previously a private function) ##### Changes - Documentation updates - utils.quit: exit message is no longer required, and closes the Lua state (on 5.2+). - utils.assert_arg and utils.assert_string: now return the validated value - pl.compat: now exports the jit and jit52 flags - pretty.write: now sorts the output for easier diffs #293 ##### Fixes - utils.raise changed the global on_error-level when passing in bad arguments - utils.writefile now checks and returns errors when writing - compat.execute now handles the Windows exitcode -1 properly - types.is_empty would return true on spaces always, indepedent of the parameter - types.to_bool will now compare case-insensitive for the extra passed strings - app.require_here will now properly handle an absolute base path - stringx.split will no longer append an empty match if the number of requested elements has already been reached #295 - path.common_prefix and path.relpath return the result in the original casing (only impacted Windows) #297 - dir.copyfile, dir.movefile, and dir.makepath create the new file/path with the requested casing, and no longer force lowercase (only impacted Windows) #297 - added a missing assertion on path.getmtime #291 - stringx.rpartition returned bad results on a not-found #299 #### 1.6.0 (2018-11-23) ##### New features - pl.compat now provides unpack as table.unpack on Lua 5.1 ##### Changes - utils.unpack is now documented and respects .n field of its argument. - tablex.deepcopy and tablex.deepcompare are now cycle aware (#262) - Installing through LuaRocks will now include the full rendered documentation ##### Fixes - Fixed seq.last returning nil instead of an empty list when given an empty iterator (#253). - pl.template now applies tostring when substituting values in templates, avoiding errors when they are not strings or numbers (#256). - Fixed pl.import_into not importing some Penlight modules (#268). - Fixed version number stuck at 1.5.2 (#260). - Fixed types.is_empty returning true on tables containing false key (#267). - Fixed test.assertraise throwing an error when passed an array with a function to call plus its arguments (#272). - Fixed test.assertraise not throwing an error when given function does not error but instead returns a string matching given error pattern. - Fixed placeholder expressions being evaluated with wrong precedence of binary and unary negation. - Fixed placeholder expressions being evaluated assuming wrong binary operator associativity (e.g. _1-(_2+_3) was evaluated as (_1-_2)+_3. - Fixed placeholder expressions being evaluated as if unary operators take precedence over power operator (e.g. (-_1)^_2) was evaluated as -(_1^2)). - Fixed vulnerable backtracking pattern in pl.stringx.strip (#275)
#### 1.7.0 (2019-10-14) ##### New features - utils.quote_arg will now optionally take an array of arguments and escape them all into a single string. - app.parse_args now accepts a 3rd parameter with a list of valid flags and aliases - app.script_name returns the name of the current script (previously a private function) ##### Changes - Documentation updates - utils.quit: exit message is no longer required, and closes the Lua state (on 5.2+). - utils.assert_arg and utils.assert_string: now return the validated value - pl.compat: now exports the jit and jit52 flags - pretty.write: now sorts the output for easier diffs #293 ##### Fixes - utils.raise changed the global on_error-level when passing in bad arguments - utils.writefile now checks and returns errors when writing - compat.execute now handles the Windows exitcode -1 properly - types.is_empty would return true on spaces always, indepedent of the parameter - types.to_bool will now compare case-insensitive for the extra passed strings - app.require_here will now properly handle an absolute base path - stringx.split will no longer append an empty match if the number of requested elements has already been reached #295 - path.common_prefix and path.relpath return the result in the original casing (only impacted Windows) #297 - dir.copyfile, dir.movefile, and dir.makepath create the new file/path with the requested casing, and no longer force lowercase (only impacted Windows) #297 - added a missing assertion on path.getmtime #291 - stringx.rpartition returned bad results on a not-found #299 #### 1.6.0 (2018-11-23) ##### New features - pl.compat now provides unpack as table.unpack on Lua 5.1 ##### Changes - utils.unpack is now documented and respects .n field of its argument. - tablex.deepcopy and tablex.deepcompare are now cycle aware (#262) - Installing through LuaRocks will now include the full rendered documentation ##### Fixes - Fixed seq.last returning nil instead of an empty list when given an empty iterator (#253). - pl.template now applies tostring when substituting values in templates, avoiding errors when they are not strings or numbers (#256). - Fixed pl.import_into not importing some Penlight modules (#268). - Fixed version number stuck at 1.5.2 (#260). - Fixed types.is_empty returning true on tables containing false key (#267). - Fixed test.assertraise throwing an error when passed an array with a function to call plus its arguments (#272). - Fixed test.assertraise not throwing an error when given function does not error but instead returns a string matching given error pattern. - Fixed placeholder expressions being evaluated with wrong precedence of binary and unary negation. - Fixed placeholder expressions being evaluated assuming wrong binary operator associativity (e.g. _1-(_2+_3) was evaluated as (_1-_2)+_3. - Fixed placeholder expressions being evaluated as if unary operators take precedence over power operator (e.g. (-_1)^_2) was evaluated as -(_1^2)). - Fixed vulnerable backtracking pattern in pl.stringx.strip (#275)
#### 1.7.0 (2019-10-14) ##### New features - utils.quote_arg will now optionally take an array of arguments and escape them all into a single string. - app.parse_args now accepts a 3rd parameter with a list of valid flags and aliases - app.script_name returns the name of the current script (previously a private function) ##### Changes - Documentation updates - utils.quit: exit message is no longer required, and closes the Lua state (on 5.2+). - utils.assert_arg and utils.assert_string: now return the validated value - pl.compat: now exports the jit and jit52 flags - pretty.write: now sorts the output for easier diffs #293 ##### Fixes - utils.raise changed the global on_error-level when passing in bad arguments - utils.writefile now checks and returns errors when writing - compat.execute now handles the Windows exitcode -1 properly - types.is_empty would return true on spaces always, indepedent of the parameter - types.to_bool will now compare case-insensitive for the extra passed strings - app.require_here will now properly handle an absolute base path - stringx.split will no longer append an empty match if the number of requested elements has already been reached #295 - path.common_prefix and path.relpath return the result in the original casing (only impacted Windows) #297 - dir.copyfile, dir.movefile, and dir.makepath create the new file/path with the requested casing, and no longer force lowercase (only impacted Windows) #297 - added a missing assertion on path.getmtime #291 - stringx.rpartition returned bad results on a not-found #299 #### 1.6.0 (2018-11-23) ##### New features - pl.compat now provides unpack as table.unpack on Lua 5.1 ##### Changes - utils.unpack is now documented and respects .n field of its argument. - tablex.deepcopy and tablex.deepcompare are now cycle aware (#262) - Installing through LuaRocks will now include the full rendered documentation ##### Fixes - Fixed seq.last returning nil instead of an empty list when given an empty iterator (#253). - pl.template now applies tostring when substituting values in templates, avoiding errors when they are not strings or numbers (#256). - Fixed pl.import_into not importing some Penlight modules (#268). - Fixed version number stuck at 1.5.2 (#260). - Fixed types.is_empty returning true on tables containing false key (#267). - Fixed test.assertraise throwing an error when passed an array with a function to call plus its arguments (#272). - Fixed test.assertraise not throwing an error when given function does not error but instead returns a string matching given error pattern. - Fixed placeholder expressions being evaluated with wrong precedence of binary and unary negation. - Fixed placeholder expressions being evaluated assuming wrong binary operator associativity (e.g. _1-(_2+_3) was evaluated as (_1-_2)+_3. - Fixed placeholder expressions being evaluated as if unary operators take precedence over power operator (e.g. (-_1)^_2) was evaluated as -(_1^2)). - Fixed vulnerable backtracking pattern in pl.stringx.strip (#275)
- utils.quote_arg will now optionally take an array of arguments and escape them all into a single string. - app.parse_args now accepts a 3rd parameter with a list of valid flags and aliases - app.script_name returns the name of the current script (previously a private function) - Documentation updates - utils.quit: exit message is no longer required, and closes the Lua state (on 5.2+). - utils.assert_arg and utils.assert_string: now return the validated value - pl.compat: now exports the jit and jit52 flags - pretty.write: now sorts the output for easier diffs #293 - utils.raise changed the global on_error-level when passing in bad arguments - utils.writefile now checks and returns errors when writing - compat.execute now handles the Windows exitcode -1 properly - types.is_empty would return true on spaces always, indepedent of the parameter - types.to_bool will now compare case-insensitive for the extra passed strings - app.require_here will now properly handle an absolute base path - stringx.split will no longer append an empty match if the number of requested elements has already been reached #295 - path.common_prefix and path.relpath return the result in the original casing (only impacted Windows) #297 - dir.copyfile, dir.movefile, and dir.makepath create the new file/path with the requested casing, and no longer force lowercase (only impacted Windows) #297 - added a missing assertion on path.getmtime #291 - stringx.rpartition returned bad results on a not-found #299 - pl.compat now provides unpack as table.unpack on Lua 5.1 - utils.unpack is now documented and respects .n field of its argument. - tablex.deepcopy and tablex.deepcompare are now cycle aware (#262) - Installing through LuaRocks will now include the full rendered documentation - Fixed seq.last returning nil instead of an empty list when given an empty iterator (#253). - pl.template now applies tostring when substituting values in templates, avoiding errors when they are not strings or numbers (#256). - Fixed pl.import_into not importing some Penlight modules (#268). - Fixed version number stuck at 1.5.2 (#260). - Fixed types.is_empty returning true on tables containing false key (#267). - Fixed test.assertraise throwing an error when passed an array with a function to call plus its arguments (#272). - Fixed test.assertraise not throwing an error when given function does not error but instead returns a string matching given error pattern. - Fixed placeholder expressions being evaluated with wrong precedence of binary and unary negation. - Fixed placeholder expressions being evaluated assuming wrong binary operator associativity (e.g. _1-(_2+_3) was evaluated as (_1-_2)+_3. - Fixed placeholder expressions being evaluated as if unary operators take precedence over power operator (e.g. (-_1)^_2) was evaluated as -(_1^2)). - Fixed vulnerable backtracking pattern in pl.stringx.strip (#275)
#### 1.7.0 (2019-10-14) ##### New features - utils.quote_arg will now optionally take an array of arguments and escape them all into a single string. - app.parse_args now accepts a 3rd parameter with a list of valid flags and aliases - app.script_name returns the name of the current script (previously a private function) ##### Changes - Documentation updates - utils.quit: exit message is no longer required, and closes the Lua state (on 5.2+). - utils.assert_arg and utils.assert_string: now return the validated value - pl.compat: now exports the jit and jit52 flags - pretty.write: now sorts the output for easier diffs #293 ##### Fixes - utils.raise changed the global on_error-level when passing in bad arguments - utils.writefile now checks and returns errors when writing - compat.execute now handles the Windows exitcode -1 properly - types.is_empty would return true on spaces always, indepedent of the parameter - types.to_bool will now compare case-insensitive for the extra passed strings - app.require_here will now properly handle an absolute base path - stringx.split will no longer append an empty match if the number of requested elements has already been reached #295 - path.common_prefix and path.relpath return the result in the original casing (only impacted Windows) #297 - dir.copyfile, dir.movefile, and dir.makepath create the new file/path with the requested casing, and no longer force lowercase (only impacted Windows) #297 - added a missing assertion on path.getmtime #291 - stringx.rpartition returned bad results on a not-found #299 #### 1.6.0 (2018-11-23) ##### New features - pl.compat now provides unpack as table.unpack on Lua 5.1 ##### Changes - utils.unpack is now documented and respects .n field of its argument. - tablex.deepcopy and tablex.deepcompare are now cycle aware (#262) - Installing through LuaRocks will now include the full rendered documentation ##### Fixes - Fixed seq.last returning nil instead of an empty list when given an empty iterator (#253). - pl.template now applies tostring when substituting values in templates, avoiding errors when they are not strings or numbers (#256). - Fixed pl.import_into not importing some Penlight modules (#268). - Fixed version number stuck at 1.5.2 (#260). - Fixed types.is_empty returning true on tables containing false key (#267). - Fixed test.assertraise throwing an error when passed an array with a function to call plus its arguments (#272). - Fixed test.assertraise not throwing an error when given function does not error but instead returns a string matching given error pattern. - Fixed placeholder expressions being evaluated with wrong precedence of binary and unary negation. - Fixed placeholder expressions being evaluated assuming wrong binary operator associativity (e.g. _1-(_2+_3) was evaluated as (_1-_2)+_3. - Fixed placeholder expressions being evaluated as if unary operators take precedence over power operator (e.g. (-_1)^_2) was evaluated as -(_1^2)). - Fixed vulnerable backtracking pattern in pl.stringx.strip (#275)
How can do this in DB less mode?? When I use regex in domain part kong is throwing an error. I came across https://docs.konghq.com/hub/flash/set-dynamic-upstream-host/ which is not compatible in DB less mode. |
@sudheer-jerripotula This is a very old issue that was closed a long time ago — any routing configuration that's supported with DB mode should work with DB-less as well. Which error are you getting?
The info in that documentation page looks inconsistent (I just posted a docs issue about it), but the sidebar info says it is compatible with DB-less. Did you give that plugin a try? |
It's extremely common to use wildcards in DNS records, and I've hit a case where I need to have kong match all requests with the host
*.example.org
. Currently kong only works with an exact match ofpublic_dns
but my DNS record is set to*.example.org
so I'd like Kong to matchexample.com
,something.example.com
and evena.b.c.example.com
.Relevant nginx doc: http://nginx.org/en/docs/http/server_names.html#wildcard_names
The text was updated successfully, but these errors were encountered: