linuxserver / docker-nginx

GNU General Public License v3.0
148 stars 46 forks source link

nginx: [emerg] unknown directive "lua_load_resty_core" in /config/nginx/nginx.conf:88 in latest image #70

Closed ghost closed 3 years ago

ghost commented 3 years ago

Expected Behavior

The docker image tagged "latest" should run without any errors ;)

Current Behavior / Steps to Reproduce

Booting the docker image tagged latest as of now (version-333315c5), the following error is thrown:

nginx: [emerg] unknown directive "lua_load_resty_core" in /config/nginx/nginx.conf:88

Going back to an older image (version-25aad05b) does not have this issue.

Environment

OS: Debian 10 CPU architecture: x86_64 How docker service was installed: Via the docker docs instructions

Command used to create docker container (run/create/compose/screenshot)

docker-compose up -d

Docker logs

> docker-compose logs nginx
Attaching to nginx
nginx            | [mod-init] Attempting to run Docker Modification Logic
nginx            | [mod-init] Applying linuxserver/mods:nginx-proxy-confs files to container
nginx            | [s6-init] making user provided files available at /var/run/s6/etc...exited 0.
nginx            | [s6-init] ensuring user provided files have correct perms...exited 0.
nginx            | [fix-attrs.d] applying ownership & permissions fixes...
nginx            | [fix-attrs.d] done.
nginx            | [cont-init.d] executing container initialization scripts...
nginx            | [cont-init.d] 01-envfile: executing... 
nginx            | [cont-init.d] 01-envfile: exited 0.
nginx            | [cont-init.d] 10-adduser: executing... 
nginx            | 
nginx            | -------------------------------------
nginx            |           _         ()
nginx            |          | |  ___   _    __
nginx            |          | | / __| | |  /  \ 
nginx            |          | | \__ \ | | | () |
nginx            |          |_| |___/ |_|  \__/
nginx            | 
nginx            | 
nginx            | Brought to you by linuxserver.io
nginx            | -------------------------------------
nginx            | 
nginx            | To support LSIO projects visit:
nginx            | https://www.linuxserver.io/donate/
nginx            | -------------------------------------
nginx            | GID/UID
nginx            | -------------------------------------
nginx            | 
nginx            | User uid:    1000
nginx            | User gid:    1000
nginx            | -------------------------------------
nginx            | 
nginx            | [cont-init.d] 10-adduser: exited 0.
nginx            | [cont-init.d] 20-config: executing... 
nginx            | [cont-init.d] 20-config: exited 0.
nginx            | [cont-init.d] 30-keygen: executing... 
nginx            | using keys found in /config/keys
nginx            | [cont-init.d] 30-keygen: exited 0.
nginx            | [cont-init.d] 40-config: executing... 
nginx            | Removing lua specific info from nginx.conf
nginx            | Starting 2019/12/30, GeoIP2 databases require personal license key to download. Please manually download/update the GeoIP2 db and save as /config/geoip2db/GeoLite2-City.mmdb
nginx            | [cont-init.d] 40-config: exited 0.
nginx            | [cont-init.d] 99-custom-files: executing... 
nginx            | [custom-init] no custom files found exiting...
nginx            | [cont-init.d] 99-custom-files: exited 0.
nginx            | [cont-init.d] 99-proxy-conf: executing... 
nginx            | [cont-init.d] 99-proxy-conf: exited 0.
nginx            | [cont-init.d] done.
nginx            | [services.d] starting services
nginx            | nginx: [emerg] unknown directive "lua_load_resty_core" in /config/nginx/nginx.conf:88
nginx            | [services.d] done.
nginx            | nginx: [emerg] unknown directive "lua_load_resty_core" in /config/nginx/nginx.conf:88
nginx            | nginx: [emerg] unknown directive "lua_load_resty_core" in /config/nginx/nginx.conf:88 
...

Thank you for your work. I am happy to provide more context if necessary.

github-actions[bot] commented 3 years ago

Thanks for opening your first issue here! Be sure to follow the bug or feature issue templates!

j0nnymoe commented 3 years ago

Comment out that line or delete the file and restart the container. The issue is our command here: https://github.com/linuxserver/docker-nginx/blob/master/root/etc/cont-init.d/40-config#L7 is unable to find the lua line as it's likely you've opened the nginx.conf file and it's changed the file from tabs to spaces.

ghost commented 3 years ago

Thank you for taking the time @j0nnymoe