Open hakenmt opened 1 year ago
@hakenmt Sorry to just get to this now. [Also, I don't think I got notifications of your update edits vs new comments]
I couldn't reproduce your problem (with respect to ndk
), but I can show you how to get your sample working:
file: test.conf
server {
listen 80;
location / {
content_by_lua '
ngx.say("<p>hello nginx</p>")
';
}
}
invocation:
docker run --rm -d -p 8420:80 -v $(pwd)/test.conf:/etc/nginx/conf.d/default.conf:ro openresty/openresty:alpine
test:
> curl localhost:8420
<p>hello nginx</p>
You don't see many modules when you search because they are compiled into OpenResty's nginx
executable. You can find Lua files here: /usr/local/openresty/lualib
The documentation could use some love to show how to do this straight-forward example. Otherwise, it's very geared to people setting up their own images, rather than using them.
Try that out and if you have more issues, feel free to continue commenting on this issue.
I'm using the docker image
openresty/openresty:alpine
. I'm copying a custom nginx conf file to the image during a build.Dockerfile
And this is my conf file
I get an error trying to run the container,
[emerg] dlopen() "/usr/local/openresty/nginx/modules/ndk_http_module.so" failed (Error loading shared library /usr/local/openresty/nginx/modules/ndk_http_module.so: No such file or directory) in /usr/local/openresty/nginx/conf/nginx.conf:1
I feel like I'm following the basic getting started instructions, so not sure what is wrong with the conf file I'm providing.
Update: I built an image without copying my config file so I could login to the container, listing the modules directory, I get this:
So it looks like the Lua modules aren't placed there? Where should they be?
Update 2: Do I need to install the modules myself? From reading all of the openresty documentation, I was under the impression that everything was already bundled into the build and that wouldn't be necessary.