| 1 |
Deploy Traefik configuration |
| 2 |
============================ |
| 3 |
|
| 4 |
FastCGI server |
| 5 |
-------------- |
| 6 |
|
| 7 |
For now, Traefik does not support FastCGI, so it can't be used with the |
| 8 |
default provided llng-fastcgi-server. It can work with the PSGI server, |
| 9 |
if it exposes an HTTP socket. See :doc:`Advanced PSGI usage<psgi>`. |
| 10 |
|
| 11 |
For example, to use the Traefik handler with uWSGI, exposing an HTTP socket |
| 12 |
binding on 127.0.0.1:8183 |
| 13 |
|
| 14 |
:: |
| 15 |
|
| 16 |
cd /usr/share/lemonldap-ng/llng-server && SOURCE_SERVER=traefik /sbin/uwsgi \ |
| 17 |
--plugin psgi \ |
| 18 |
--psgi llng-server.psgi \ |
| 19 |
--master \ |
| 20 |
--workers 2 \ |
| 21 |
--max-worker-lifetime 86400 \ |
| 22 |
--max-requests 10000 \ |
| 23 |
--disable-logging \ |
| 24 |
--harakiri 30 \ |
| 25 |
--buffer-size 65535 \ |
| 26 |
--limit-post 0 \ |
| 27 |
--die-on-term \ |
| 28 |
--http-socket 127.0.0.1:8183 |
| 29 |
|
| 30 |
.. note:: |
| 31 |
you can create a systemd unit, but as Traefik is mainly used in a |
| 32 |
containers context, you can use a command similar to the previous one as |
| 33 |
an entrypoint. |
| 34 |
|
| 35 |
Then, to configure Traefik's middleware to use it, you can use this |
| 36 |
configuration fragment: |
| 37 |
|
| 38 |
:: |
| 39 |
|
| 40 |
http: |
| 41 |
middlewares: |
| 42 |
lemonldap: |
| 43 |
forwardAuth: |
| 44 |
address: http://127.0.0.1:8183 |
| 45 |
authResponseHeaders: |
| 46 |
- Cookie |
| 47 |
authResponseHeadersRegex: '^Auth-' |
| 48 |
|
| 49 |
.. danger:: |
| 50 |
With this configuration, only HTTP headers starting with ``Auth-`` will be |
| 51 |
protected from injection by malicious users. When you use Traefik, it is |
| 52 |
highly recommended to only export headers that start with this prefix, unless |
| 53 |
you have a very good understanding of how the ``authResponseHeaders`` and |
| 54 |
``authResponseHeadersRegex`` options in Traefik work. |
| 55 |
|
| 56 |
Then to protect an app with Lemonldap::NG: |
| 57 |
|
| 58 |
:: |
| 59 |
|
| 60 |
tags = [ |
| 61 |
"traefik.enable=true", |
| 62 |
"traefik.http.routers.whoami.rule=Path(`/whoami`)", |
| 63 |
"traefik.http.routers.whoami.entrypoints=https", |
| 64 |
"traefik.http.routers.whoami.middlewares=lemonldap@file" |
| 65 |
] |
| 66 |
|
| 67 |
Install LLNG FastCGI server |
| 68 |
--------------------------- |
| 69 |
|
| 70 |
Debian/Ubuntu |
| 71 |
~~~~~~~~~~~~~ |
| 72 |
|
| 73 |
:: |
| 74 |
|
| 75 |
apt install lemonldap-ng-fastcgi-server |
| 76 |
|
| 77 |
Enable and start the service : |
| 78 |
|
| 79 |
:: |
| 80 |
|
| 81 |
systemctl enable llng-fastcgi-server |
| 82 |
systemctl start llng-fastcgi-server |
| 83 |
|
| 84 |
Red Hat/CentOS |
| 85 |
~~~~~~~~~~~~~~ |
| 86 |
|
| 87 |
:: |
| 88 |
|
| 89 |
yum install lemonldap-ng-nginx lemonldap-ng-fastcgi-server |
| 90 |
|
| 91 |
Enable and start the service : |
| 92 |
|
| 93 |
:: |
| 94 |
|
| 95 |
systemctl enable llng-fastcgi-server |
| 96 |
systemctl start llng-fastcgi-server |
| 97 |
|
| 98 |
See also |
| 99 |
-------- |
| 100 |
|
| 101 |
- :doc:`Deploy Caddy configuration<configcaddy>` |