I’m having trouble trying to run kong with custom nginx configuration on docker.
I have simpliest possible template:
worker_processes ${{NGINX_WORKER_PROCESSES}}; # can be set by kong.conf
daemon ${{NGINX_DAEMON}}; # can be set by kong.conf
pid pids/nginx.pid; # this setting is mandatory
error_log logs/error.log ${{LOG_LEVEL}}; # can be set by kong.conf
events {
use epoll; # custom setting
multi_accept on;
}
http {
# include default Kong Nginx config
include 'nginx-kong.conf';
}
Along with simple Dockerfile:
FROM kong:0.14.1-alpine
COPY . /etc/kong/
CMD kong start --nginx-conf /etc/kong/nginx.template
I then configure, build and run container along with postgresql container with docker-compose, but I believe this part of setup is irrelevant. I tested it before with clean kong:0.14.1-alpine image and it worked.
My setup with custom config returns an error on start:
kong_1 | Error: /usr/local/share/lua/5.1/kong/cmd/start.lua:28: failed to compile nginx config template: [string "TMP"]:77: attempt to index global 'el' (a nil value)
kong_1 | stack traceback:
kong_1 | [string "TMP"]:77: in function <[string "TMP"]:1>
kong_1 | [C]: in function 'xpcall'
kong_1 | /usr/local/share/lua/5.1/pl/template.lua:138: in function 'substitute'
kong_1 | /usr/local/share/lua/5.1/kong/cmd/utils/prefix_handler.lua:115: in function 'compile_nginx_conf'
kong_1 | /usr/local/share/lua/5.1/kong/cmd/utils/prefix_handler.lua:246: in function 'prepare_prefix'
kong_1 | /usr/local/share/lua/5.1/kong/cmd/start.lua:28: in function </usr/local/share/lua/5.1/kong/cmd/start.lua:27>
kong_1 | [C]: in function 'xpcall'
kong_1 | /usr/local/share/lua/5.1/kong/cmd/start.lua:27: in function 'cmd_exec'
kong_1 | /usr/local/share/lua/5.1/kong/cmd/init.lua:87: in function </usr/local/share/lua/5.1/kong/cmd/init.lua:87>
kong_1 | [C]: in function 'xpcall'
kong_1 | /usr/local/share/lua/5.1/kong/cmd/init.lua:87: in function </usr/local/share/lua/5.1/kong/cmd/init.lua:44>
kong_1 | /usr/local/bin/kong:7: in function 'file_gen'
kong_1 | init_worker_by_lua:48: in function <init_worker_by_lua:46>
kong_1 | [C]: in function 'xpcall'
kong_1 | init_worker_by_lua:55: in function <init_worker_by_lua:53>
kong_1 |
kong_1 | Run with --v (verbose) or --vv (debug) for more details
Did I miss something?