openbridge / nginx

NGINX Accelerated! This is a Docker image that creates a high performance (FAST!), optimized image for NGINX for use with Redis and PHP-FMP. Deliver sites and applications with performance, reliability, security, and scale. This NGINX server offers advanced performance, web and mobile acceleration, security controls, application monitoring, and management.
https://www.openbridge.com/
MIT License
233 stars 53 forks source link

Dev mode does not work #24

Closed jakst closed 6 years ago

jakst commented 6 years ago

First

Dev mode is commented on this line, so it is never activated.

Second

Dev mode does not respect the env variable NGINX_DEV_INSTALL. In fact, there is not a single reference to NGINX_DEV_INSTALL in the whole repository. Instead, some of the logic seems to reference the NGINX_CONFIG variable instead.

Example from docker-entrypoint.sh

if [[ $NGINX_CONFIG != "basic" ]]; then bots else echo "OK: Bot protection will not be activated in dev mode"; fi

Why does it check NGINX_CONFIG instead of NGINX_DEV_INSTALL?

tspicer commented 6 years ago

NGINX_CONFIG sets the overarching config path. It is a parent concept. NGINX_DEV_INSTALL is a child concept. For example, NGINX_CONFIG can be set for html or php which contains underlying configs. In both cases you may want to run them in a local development mode. There may have been a change at some point that was not reflected in the docs or was committed in error. Let me take a look and get back to you..

tspicer commented 6 years ago

I think what was missing was this:

if [[ $NGINX_DEV_INSTALL = "true" ]] && [[ $NGINX_CONFIG != "basic" ]]; then dev else echo "OK: Not installing development SSL certs or files"; fi

Since we do not want to install dev assets if someone is running in bare metal mode. Thoughts?

tspicer commented 6 years ago

I just pushed an update to fix dangling dev. Thanks for pointing it out.

jakst commented 6 years ago

The new messages about bare metal make way more sense. Nice 👍