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
* 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:
15
-
* [for the apt-installed nginx module version](./services/nginx/etc/nginx/sites-enabled/default#L9)
16
-
* [for the compiled nginx module version](./services/nginx-compiled/etc/nginx/nginx.conf#L35)
17
-
```nginx
18
-
redirectionio_project_key PUT HERE YOUR PROJECT KEY;
14
+
* 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
15
+
* copy the `.env.dist` file to `.env` and paste your `project key` in it:
16
+
```sh
17
+
cp .env.dist .env
18
+
```
19
+
* choose one of the docker layouts (see below), and:
20
+
```sh
21
+
cd <your choice>
19
22
```
20
-
The `project key` can be found on the "Instances" screen of your project:
21
-
simply click on "Setup on your infrastructure".
22
23
* build the infrastructure:
23
24
```sh
24
-
docker-compose build
25
+
dockercompose build
25
26
```
26
27
* run it:
27
28
```sh
28
-
docker-compose up -d
29
+
dockercompose up -d
29
30
```
31
+
* open your browser and go to [http://localhost:8080/](http://localhost:8080/)
30
32
31
-
Head to:
32
-
* [http://localhost:8080/](http://localhost:8080/) to use a nginx module installed from our packages repository.
33
-
* [http://localhost:8081/](http://localhost:8081/) to use a nginx module compiled during the install.
34
-
35
-
## Explanations
36
-
37
-
The `service` directory contains three services:
38
-
39
-
* **redirectionio-agent**: a simple Dockerfile to get the agent running
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
45
-
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.
49
-
50
-
### redirectionio-agent
51
-
52
-
The agent is installed using our [manual installation](https://redirection.io/documentation/developer-documentation/installation-of-the-agent#manual-installation) instructions. Note that we have enabled a `/var/lib/redirectionio` volume, used to store [redirection.io agent's cache data](https://redirection.io/documentation/developer-documentation/agent-configuration-reference#datadir).
53
-
54
-
### nginx
55
-
56
-
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](https://redirection.io/documentation/developer-documentation/nginx-module#debian-and-apt-based-distributions).
57
-
58
-
It defines a single VirtualHost, [for which redirection is enabled](./services/nginx/etc/nginx/sites-enabled/default#L8-L9).
59
-
60
-
### nginx-compiled
61
-
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.
65
-
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.
33
+
## Available Docker layouts
70
34
71
-
This is what the [nginx Dockerfile](./services/nginx-compiled/Dockerfile) achieves. Basically:
72
-
* it downloads the nginx sources in the same version like the installed `nginx` binary
73
-
* it downloads and build the libredirectionio
74
-
* it downloads the redirection.io nginx module
75
-
* it builds this module with the same configure arguments the installed `nginx` binary was configured
76
-
* it moves the build module in the right folder
77
-
* it [loads the module](./services/nginx-compiled/etc/nginx/nginx.conf#L7) in the nginx configuration
78
-
* it [enables redirection.io for the server](./services/nginx-compiled/etc/nginx/nginx.conf#L34-L35)
35
+
* [**agent-as-reverse-proxy**](./agent-as-reverse-proxy/README.md): the redirection.io agent, installed from our repository, is used as a reverse proxy. This is the most simple and recommended setup.
36
+
* [**apache-module**](./apache-module/README.md): a simple Apache setup, with redirection.io module installed from our apt repository
37
+
* [**apache-module-custom**](./apache-module-custom/README.md): an Apache setup with the redirection.io module compiled from sources
38
+
* [**nginx-module**](./nginx-module/README.md): a simple nginx setup, with redirection.io module installed from our apt repository
39
+
* [**nginx-module-custom**](./nginx-module-custom/README.md): a nginx setup with the redirection.io module compiled from sources
# Using the redirection.io agent as a reverse proxy in a Docker environment
2
+
3
+
This example shows how to use the redirection.io agent as a reverse proxy in a Docker environment. It is the most simple and versatile way to install redirection.io in your Docker stack, as it can be used with any backend service. The redirection.io agent act as a very fast reverse proxy, intercepting requests and responses between the client and the backend service.
4
+
5
+
> [!TIP]
6
+
> You can read more about [the redirection.io agent as a reverse proxy in our documentation](https://redirection.io/documentation/developer-documentation/the-agent-as-a-reverse-proxy).
7
+
8
+
## Description
9
+
10
+
The `service` directory contains the **redirectionio-agent** service: a simple Dockerfile to get the agent running. The [`/etc/redirectionio/agent.yml`](./services/redirectionio-agent/etc/redirectionio/agent.yml) file is used to configure the agent and proxify the traffic to a backend service.
11
+
12
+
The `docker-compose.yml` file also mentions a `nginx` service, which is a simple Nginx server used as a backend service. You can replace it with your own backend service.
13
+
14
+

15
+
16
+
### redirectionio-agent
17
+
18
+
The agent is installed using our [manual installation](https://redirection.io/documentation/developer-documentation/installation-of-the-agent#manual-installation) instructions. Note that we have enabled a `/var/lib/redirectionio` volume, used to store [redirection.io agent's cache data](https://redirection.io/documentation/developer-documentation/agent-configuration-reference#datadir).
0 commit comments