Docker Image Review: jwilder/nginx-proxy
Ever wondered wether there is a good alternative for scenarios, where a full featured ingress proxy would be overkill? Here it comes:
jwilder/nginx-proxy
. The image can especially be useful when setting up an ingress concept for the first time. Nginx is well known in the world of classic server administration and web hosting. So why not use your familiar web server also in your containerised environment?
Compared to full featured ingress routers like Traefik the image enables you to reuse your existing know-how, and also some of your configurations. The concept of a ingress router is similar to a reverse proxy. It is to hide all other services behind a single container, as you would do with a reverse proxy. The advantages are obvious: You don’t have to care about things like Encryption or authentication for each and every service separately. It also gives you the possibility to do things like load-balancing or gathering statistics across all your services.
Usecase
Jason Wilder himself explains the use case of jwilder/nginx-proxy
very detailed at his Blog. The usage of this image is (at the time of writing) limited to static setups, like docker-compose files. If you are running a more dynamic setups - e.g. where containers are created on the fly, solutions like Traefik are more suitable. At the time of writing the image is not able to automatically pick up backend services that have no special jwilder/nginx-proxy
configuration attached.
Configuration
The main use cases can be configured entirely by defining environment variables on the services you want to proxy. Unfortunately this has also the side effect, that the nginx-proxy configuration is exposed to your backend-service. Using labels for configuration instead, would not contaminate your environment.
Activity
The community around jwilder/nginx-proxy
is very active. Its Github repository has over 60 contributors. Updates of the image happen very frequently, which is very important for the service being the first line of defence in your setup. Especially when keeping in mind that using docker images adds additional potential insecure layers between the you and the software manufacturer.
Scaling
The service itself cannot be scaled as easy as other ingress router solutions. For scaling the instances dynamically, you need to run a dedicated load-balancer that distributes the calls to you jwilder/nginx-proxy
instances.
Conclusion
Jason’s nginx-based reverse proxy image is one of the best ingress-routers available for static setups. It is especially useful in static environments, e.g. classic servers where the services run in containers. It’s nature to generate all necessary configuration out of a few configuration settings is outstanding. It is one of the few images being available that do not need any configuration-files at all. Even for beginners with no nginx knowledge at all, this really lowers the hurdle of configuring an ingress router.