-
Notifications
You must be signed in to change notification settings - Fork 5k
Closed
Description
Bug:
Kong is unable to find nginx even though it it defined in my path.
Background:
My path looks like the following
/app/tools/opt/bin:/usr/local/bin:/usr/bin:/bin
and typing in nginx -v returns
nginx version: openresty/1.7.10.2
and the path to nginx is /app/tools/opt/bin/nginx
Potential Culprit?
My knowledge on Lua is limited, but it looks like the paths used to search for the nginx binary are defined here:
local NGINX_SEARCH_PATHS = {
"/usr/local/openresty/nginx/sbin/",
"/usr/local/opt/openresty/bin/",
"/usr/local/bin/",
"/usr/sbin/"
}Where the logic to find the nginx binary is done here:
local function find_nginx()
for i = 1, #NGINX_SEARCH_PATHS + 1 do
local prefix = NGINX_SEARCH_PATHS[i] and NGINX_SEARCH_PATHS[i] or ""
local to_check = prefix..NGINX_BIN
if is_openresty(to_check) then
return to_check
end
end
endSo it looks like only NGINX_SEARCH_PATHS is used to search for the binary and not $PATH? I ask because I see the following comment which makes it seem like $PATH is being searched?
-- Try to find an `nginx` executable in defined paths, or in $PATHMetadata
Metadata
Assignees
Labels
No labels