Skip to content

redirectionio/docker-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

redirection.io nginx module Docker example

It is quite common to use Docker in development or production environments. As this has been requested by several of our users, we have set up a short example of a Docker stack for the redirection.io agent and nginx module.

Usage

Head to:

Explanations

The service directory contains three services:

  • redirectionio-agent: a simple Dockerfile to get the agent running
  • nginx: a nginx Dockerfile based on the Ubuntu 20.04 image, with nginx and the redirection.io nginx module installed from our apt repository
  • nginx-compiled: a nginx Dockerfile based on the official nginx image, with all the directives to get the redirection.io nginx module built and loaded

Depending on your install requirements, the version of nginx that you are using and other specific nginx modules that you want to use, you can either use the nginx or the nginx-compiled services as examples.

redirectionio-agent

The agent is installed using our manual installation instructions. Note that we have enabled a /var/lib/redirectionio volume, used to store redirection.io agent's cache data.

nginx

This is a standard Ubuntu 20.04 image, with the distribution-provided nginx package, and libnginx-mod-redirectionio installed from our deb repository, as explained in our documentation.

It defines a single VirtualHost, for which redirection is enabled.

nginx-compiled

Nginx dynamic modules require binary compatibility to be properly loaded, which means that they have to be compiled with the exact same configuration directives like your nginx binary.

redirection.io offers APT and RPM repositories, with many versions of libnginx-mod-redirectionio to match classical distribution nginx packages. However, should your nginx install vary from these traditional layouts, you will be forced to compile our nginx module yourself, to match your own nginx version.

This is what the nginx Dockerfile achieves. Basically:

  • it downloads the nginx sources in the same version like the installed nginx binary
  • it downloads and build the libredirectionio
  • it downloads the redirection.io nginx module
  • it builds this module with the same configure arguments the installed nginx binary was configured
  • it moves the build module in the right folder
  • it loads the module in the nginx configuration
  • it enables redirection.io for the server

Help and troubleshooting

We do not offer major support for this Docker example. However, feel free to contact us or open an issue if you have any question.

License

This code is licensed under the MIT License - see the LICENSE file for details.

Releases

No releases published

Packages

No packages published