kong reload and nginx reload


#1

We modified the log_level of kong.conf, then executed Kong reload, but this configuration did not take effect. Can Kong reload reload the configuration that I modified just like nginx reload?


#2

Can Kong reload reload the configuration that I modified just like nginx reload?

The source code of the reload action seems to indicate that this is the desired effect. If that is not happening there might be some kind of problem.

In order to reload, one of the things Kong does is re-generating an nginx config file. Is the folder where the nginx config file is (the “prefix” folder) writable by the user executing kong reload? Does the nginx log show any errors when you execute it?


#3

I implemented Kong reload using the default path, and also modified the kong.conf of the default path. The nginx log did not report any errors.


#4

I am not sure I understood this. It sounds like Kong was installed in path (A), and then you changed its installation (by modifying the config file) to point to path (B) - a different path. And then doing kong reload “did not take effect” - meaning that it didn’t move Nginx from path (A) to path (B). If my assessment is correct, that is the expected behaviour. kong reload can not “move” Nginx from the folder where it is installed to another folder. For that you need to:

  1. Change the config file to point to (A) again
  2. Execute kong stop to stop the existing Nginx in (A).
  3. Change the config file to point to (B)
  4. Execute kong start to start on the new folder (B).
  5. (optional) You might want to delete (A) at this point

From that point on, you should be able too execute kong reload so it reloads the nginx that is now in path (B).


#5

I did not modify the prefix of the Kong, only the modified configuration parameters, such as log_level, I looked at the source of the reload, and the Kong reload eventually loaded the configuration in the .kong.env file under the prefixs, causing the configuration parameters of the kong.conf that I modified did not reload. why the design was designed?


#6

I am sorry for your troubles.

Kong reload eventually loaded the configuration in the .kong.env file under the prefixs, causing the configuration parameters of the kong.conf that I modified did not reload

I think what might be happening is that you need to execute kong prepare to “regenerate” the nginx config file inside the prefix folder, and then kong reload should pick up the changes. Does this make sense?


#7

I found the same issue when I tried to turn off the access_log. My workaround is to manually edit the .kong.env file in PREFIX(/usr/local/kong by default). Hope this would be helpful.


#8

Maybe the kong.conf add plugins or something else, which might need migration, so in order for save reload, the kong.conf change is not be considered.