We've been creating Open Source PHP Docker Images. One of the variations that we're offering is "nginx-unit". If you're not aware, NGINX Unit is a complete alternative to the NGINX web server that you're probably thinking of. When I was working on providing SSL support, I kept running into the error below.
I followed the SSL documentation and would attempt to upload my certificate to NGINX Unit:
/usr/bin/curl -s -w %{http_code} -X PUT --data-binary @/etc/unit/config.d/self-signed-web.pem --unix-socket /var/run/control.unit.sock http://localhost/certificates/self-signed-web
In my case, my certificate bundle is called self-signed-web
.
The error I kept receiving was:
404: Value doesn't exist.
I was compiling NGINX Unit from source and Timo Stark pointed out I need to compile NGINX Unit with OpenSSL support.
openssl-dev
for Alpine and libssl-dev
for Debian)--openssl
flag on your configure commandHere is my Dockerfile where I am doing this:
RUN NCPU="$(getconf _NPROCESSORS_ONLN)" && \
CONFIGURE_ARGS="--prefix=/usr \
--statedir=/var/lib/unit \
--control=unix:/var/run/control.unit.sock \
--runstatedir=/var/run \
--pid=/var/run/unit.pid \
--logdir=/var/log \
--log=/dev/stdout \
--tmpdir=/var/tmp \
--user=www-data \
--group=www-data \
--openssl" && \
./configure $CONFIGURE_ARGS && \
./configure php --config=php-config --module=php && \
make -j $NCPU all && \
make install
Notice where I added --openssl
above.
Be sure you're compiling NGINX Unit with OpenSSL support. By default, it does not have the API endpoint enabled and will return "Value doesn't exist." if you don't have your options set correctly.
Professional developers choose Server Side Up to ship quality applications without surrendering control. Explore our tools and resources or work directly with us.
We're a community of 3,000+ members help each other level up our development skills.
Active Discord Members
We help each other through the challenges and share our knowledge when we learn something cool.
Stars on GitHub
Our community is active and growing.
Newsletter Subscribers
We send periodic updates what we're learning and what new tools are available. No spam. No BS.
Be the first to know about our latest releases and product updates.