Use SWAG tinyauth include files in the TinyAuth setups
This commit is contained in:
1 parent
fb3db10639
commit
4e8a68c330
26 files changed
+192
-496
No files matched your search
@@ -240,9 +240,9 @@ server {
|
||||
::
|
||||
|
||||
## Protéger AdGuard avec TinyAuth
|
||||
Ajoutez la vérification forward-auth de [TinyAuth](/serveex/security/tinyauth) directement dans `adguard.subdomain.conf`, de la même façon que dans [le tutoriel TinyAuth](/serveex/security/tinyauth#protéger-une-application-via-le-reverse-proxy). Le `location /dns-query` est laissé en dehors de la vérification `auth_request`, puisque les clients DNS-over-HTTPS ne peuvent pas faire de connexion interactive :
|
||||
Ajoutez la vérification forward-auth de [TinyAuth](/serveex/security/tinyauth) directement dans `adguard.subdomain.conf`, de la même façon que dans [le tutoriel TinyAuth](/serveex/security/tinyauth#protéger-une-application-via-le-reverse-proxy). Le `location /dns-query` est laissé en dehors de la vérification TinyAuth, puisque les clients DNS-over-HTTPS ne peuvent pas faire de connexion interactive :
|
||||
|
||||
```nginx [adguard.subdomain.conf]{28-40,43-44,69-70}
|
||||
```nginx [adguard.subdomain.conf]{28-29,32-33,58-59}
|
||||
## Version 2023/05/31
|
||||
# make sure that your adguard container is named adguard
|
||||
# make sure that your dns has a cname set for adguard
|
||||
@@ -270,23 +270,12 @@ server {
|
||||
# enable for Authentik (requires authentik-location.conf in the location block)
|
||||
#include /config/nginx/authentik-server.conf;
|
||||
|
||||
location /tinyauth {
|
||||
internal;
|
||||
proxy_pass http://tinyauth:3000/api/auth/nginx;
|
||||
proxy_pass_request_body off;
|
||||
proxy_set_header Content-Length "";
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header X-Forwarded-Host $http_host;
|
||||
proxy_set_header X-Forwarded-Uri $request_uri;
|
||||
}
|
||||
|
||||
location @tinyauth_login {
|
||||
return 302 https://tinyauth.mondomaine.fr/login?redirect_uri=$scheme://$http_host$request_uri;
|
||||
}
|
||||
# enable for Tinyauth (requires tinyauth-location.conf in the location block)
|
||||
include /config/nginx/tinyauth-server.conf;
|
||||
|
||||
location / {
|
||||
auth_request /tinyauth;
|
||||
error_page 401 = @tinyauth_login;
|
||||
# enable for Tinyauth (requires tinyauth-server.conf in the server block)
|
||||
include /config/nginx/tinyauth-location.conf;
|
||||
|
||||
# enable the next two lines for http auth
|
||||
#auth_basic "Restricted";
|
||||
@@ -311,8 +300,8 @@ server {
|
||||
}
|
||||
|
||||
location /control {
|
||||
auth_request /tinyauth;
|
||||
error_page 401 = @tinyauth_login;
|
||||
# enable for Tinyauth (requires tinyauth-server.conf in the server block)
|
||||
include /config/nginx/tinyauth-location.conf;
|
||||
|
||||
include /config/nginx/proxy.conf;
|
||||
include /config/nginx/resolver.conf;
|
||||
@@ -339,7 +328,7 @@ server {
|
||||
|
||||
::note{to="/serveex/security/tinyauth#exposer-tinyauth-avec-swag"}
|
||||
|
||||
Le bloc `location /tinyauth` s'exécute dans le conteneur de SWAG lui-même, SWAG doit donc être sur le réseau Docker de TinyAuth pour le joindre par son nom (`tinyauth` ici). Cela devrait déjà être en place depuis **l'exposition de TinyAuth**. Si vous rencontrez une erreur, revérifiez que le fichier compose de SWAG a toujours ce réseau rattaché.
|
||||
La vérification `/tinyauth` s'exécute dans le conteneur de SWAG lui-même, SWAG doit donc être sur le réseau Docker de TinyAuth pour le joindre par son nom (`tinyauth` ici). Cela devrait déjà être en place depuis **l'exposition de TinyAuth**. Si vous rencontrez une erreur, revérifiez que le fichier compose de SWAG a toujours ce réseau rattaché.
|
||||
::
|
||||
|
||||
::tip{icon=""}
|
||||
|
||||
Reference in new issue
Block a user