Hi,
In my CI/CD process, I define prefix variable and on kong.conf file I set up the path to my nginx configuration.
kong.conf:
prefix = /apps/current/logs
declarative_config = conf/kong.yml
log_level = debug
anonymous_reports = off
proxy_listen = 0.0.0.0:9101
admin_listen = 0.0.0.0:9102
nginx_daemon = on
mem_cache_size = 512m
db_cache_ttl = 0
database = off
nginx_http_include = conf/monitoring.conf
When kong start, appear that error:
/usr/local/share/lua/5.1/kong/cmd/start.lua:61: /usr/local/share/lua/5.1/kong/cmd/start.lua:37: nginx configuration is invalid (exit code 1):
[ERROR ] nginx: [emerg] open() “/apps/current/logs/conf/monitoring.conf” failed (2: No such file or directory) in /apps/current/logs/nginx-kong.conf:28
[ERROR ] nginx: configuration file /apps/current/logs/nginx.conf test failed
Any help?
Inside the container
Error: nginx configuration is invalid (exit code 1):
nginx: [emerg] “server” directive is not allowed here in /apps/current/logs/nginx.conf:1
nginx: configuration file /app/current/logs/nginx.conf test failed
The check command
/apps/releases/cf0fb8f3240cc37cf93c7c3371dd3bf9ab4c8db1 $ kong check conf/monitoring.conf
configuration at conf/monitoring.conf is valid
Open issue https://github.com/Kong/kong/issues/4517