Kong: Nginx directive injection does not work for multiple directives with same name

Created on 13 Jun 2019  路  4Comments  路  Source: Kong/kong

Summary

Injection of multiple nginx directives with same name does not work. For example if I want to create multiple lua_shared_dict directives, only the last one will be injected.

Steps To Reproduce

  1. Add directives that need injection to kong.conf e.g.
nginx_http_lua_shared_dict=cache1 100k
nginx_http_lua_shared_dict=cache2 100k
nginx_http_lua_shared_dict=cache3 100k
  1. Restart kong
  2. Only the last directive is injected in nginx-kong.conf
# injected nginx_http_* directives
lua_shared_dict cache3 100k;

Additional Details & Logs

  • Kong version (1.1.2)
tasfeature

Most helpful comment

@luka1983 yes, this is known limitation, I think the proposal will be to add a lot more better injection support. The plan is clear, but we just have not had time to implement it. In addition to that we plan to add support for Nginx config includes like:

http {
  include conf.d/http/*.conf;
  server {
    include conf.d/http/proxy/*.conf;
  }
}

All 4 comments

@luka1983 yes, this is known limitation, I think the proposal will be to add a lot more better injection support. The plan is clear, but we just have not had time to implement it. In addition to that we plan to add support for Nginx config includes like:

http {
  include conf.d/http/*.conf;
  server {
    include conf.d/http/proxy/*.conf;
  }
}

@luka1983, we decided that it was not worth to add this feature after we implemented it and discussed the pros and cons. So I close this. We will add better documentation to explain the possible work-arounds. Thank you!

@luka1983, we decided that it was not worth to add this feature after we implemented it and discussed the pros and cons. So I close this. We will add better documentation to explain the possible work-arounds. Thank you!

Is there a solution to this problem now?

@tzssangglass In the end I used the hack where I modified the kong's template config file for nginx (the one kong fills with directives found in kong.conf) and manually added needed directives.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

subnetmarco picture subnetmarco  路  97Comments

nickveenhof picture nickveenhof  路  46Comments

DavidTPate picture DavidTPate  路  35Comments

jeremyjpj0916 picture jeremyjpj0916  路  81Comments

jeremyjpj0916 picture jeremyjpj0916  路  65Comments