You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
3
+
It is quite common to use Docker in development or production environments. As
4
+
this has been requested by several of our users, we have set up a short example
5
+
of a Docker stack for the redirection.io agent and nginx module.
* create an account and a project on [redirection.io](https://redirection.io), retrieve your `project key`in [redirection.io's manager](https://redirection.io/manager) and copy it in the nginx configuration file:
13
15
* [for the apt-installed nginx module version](./services/nginx/etc/nginx/sites-enabled/default#L9)
14
16
* [for the compiled nginx module version](./services/nginx-compiled/etc/nginx/nginx.conf#L35)
15
-
```nginx
16
-
redirectionio_project_key PUT HERE YOUR PROJECT KEY;
17
-
```
18
-
The `project key` can be found on the "Instances" screen of your project: simply click on "Setup on your infrastructure".
17
+
```nginx
18
+
redirectionio_project_key PUT HERE YOUR PROJECT KEY;
19
+
```
20
+
The `project key` can be found on the "Instances" screen of your project:
21
+
simply click on "Setup on your infrastructure".
19
22
* build the infrastructure:
20
-
```sh
21
-
docker-compose build
22
-
```
23
+
```sh
24
+
docker-compose build
25
+
```
23
26
* run it:
24
-
```sh
25
-
docker-compose up -d
26
-
```
27
+
```sh
28
+
docker-compose up -d
29
+
```
27
30
28
31
Head to:
29
32
* [http://localhost:8080/](http://localhost:8080/) to use a nginx module installed from our packages repository.
@@ -34,10 +37,15 @@ Head to:
34
37
The `service` directory contains three services:
35
38
36
39
* **redirectionio-agent**: a simple Dockerfile to get the agent running
37
-
***nginx**: a nginx Dockerfile based on the Ubuntu 20.04 image, with nginx and the redirection.io nginx module installed from our apt repository
38
-
***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
40
+
* **nginx**: a nginx Dockerfile based on the Ubuntu 20.04 image, with nginx and
41
+
the redirection.io nginx module installed from our apt repository
42
+
* **nginx-compiled**: a nginx Dockerfile based on the official nginx image,
43
+
with all the directives to get the redirection.io nginx module built and
44
+
loaded
39
45
40
-
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.
46
+
Depending on your install requirements, the version of nginx that you are using
47
+
and other specific nginx modules that you want to use, you can either use the
48
+
`nginx` or the `nginx-compiled` services as examples.
41
49
42
50
### redirectionio-agent
43
51
@@ -51,9 +59,14 @@ It defines a single VirtualHost, [for which redirection is enabled](./services/n
51
59
52
60
### nginx-compiled
53
61
54
-
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.
62
+
Nginx dynamic modules require binary compatibility to be properly loaded, which
63
+
means that they have to be compiled with the exact same configuration directives
64
+
like your `nginx` binary.
55
65
56
-
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.
66
+
redirection.io offers APT and RPM repositories, with many versions of
67
+
`libnginx-mod-redirectionio` to match classical distribution nginx packages.
68
+
However, should your nginx install vary from these traditional layouts, you will
69
+
be forced to compile our nginx module yourself, to match your own nginx version.
57
70
58
71
This is what the [nginx Dockerfile](./services/nginx-compiled/Dockerfile) achieves. Basically:
59
72
* it downloads the nginx sources in the same version like the installed `nginx` binary
@@ -66,8 +79,10 @@ This is what the [nginx Dockerfile](./services/nginx-compiled/Dockerfile) achiev
66
79
67
80
## Help and troubleshooting
68
81
69
-
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.
82
+
We do not offer major support for this Docker example. However, feel free to
83
+
contact us or open an issue if you have any question.
70
84
71
85
## License
72
86
73
-
This code is licensed under the MIT License - see the [LICENSE](./LICENSE.md) file for details.
87
+
This code is licensed under the MIT License - see the [LICENSE](./LICENSE.md)
0 commit comments