Important
Please see Lua Server SDK for the most up-to-date hello-nginx
. This repo is deprecated.
We've built a minimal dockerized example of using the Lua SDK with OpenResty NGINX framework. For more comprehensive instructions, you can visit the Using the Lua SDK with NGINX guide or the Lua reference guide.
- On the command line, build the image from this directory with
docker build -t launchdarkly-nginx .
. - Run the demo with
docker run --rm -p 8123:80 -e LD_SDK_KEY="" -e LD_FLAG_KEY="" launchdarkly-nginx
. Set the environment variables LD_SDK_KEY to your LaunchDarkly SDK key, and, if there is an existing boolean feature flag in your LaunchDarkly project that you want to evaluate, set LD_FLAG_KEY to the flag key.
docker run --rm -p 8123:80 -e LD_SDK_KEY="1234567890abcdef" -e LD_FLAG_KEY="my-boolean-flag" launchdarkly-nginx
- Open
localhost:8123
in your browser. Toggle the flag on to see a change in the page.
You should receive the message ”Feature flag is <true/false> for this user”.