From 3f7b70e6b3600e58eae9d1e43ec5052d5aa2637e Mon Sep 17 00:00:00 2001 From: Ainar Garipov Date: Tue, 4 Apr 2023 14:05:16 +0300 Subject: [PATCH] Pull request 164: docker-fix Merge in GO/adguard-home-wiki from docker-fix to master Squashed commit of the following: commit 86872089f48770c8bfa59f88bbdd123b6c18ba01 Author: Ainar Garipov Date: Tue Apr 4 14:04:39 2023 +0300 Encryption: add info on host commit abeabbdafe07a9d825d2e18939f3b803c0a5e1f2 Merge: 1a10fa6 5de6748 Author: Ainar Garipov Date: Tue Apr 4 14:01:26 2023 +0300 Merge branch 'master' into docker-fix commit 1a10fa63c3a0ea752d6645809e65fb02ba39da65 Author: Ainar Garipov Date: Mon Apr 3 19:35:20 2023 +0300 all: add info on clients in docker; imp nginx --- Docker.md | 5 +++++ Encryption.md | 9 +++++++-- FAQ.md | 3 ++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/Docker.md b/Docker.md index 56c8f79..e8ddc36 100644 --- a/Docker.md +++ b/Docker.md @@ -95,6 +95,11 @@ Port mappings you might need: * `-p 5443:5443/tcp -p 5443:5443/udp`: add if you are going to run AdGuard Home as a [DNSCrypt] server. + ### Client IPs + +If you want AdGuardHome to see the original client IPs as opposed to something +like `172.17.0.1`, you should add `--network host` to the list of options. + ### Control the container * Start: `docker start adguardhome` diff --git a/Encryption.md b/Encryption.md index 0a40f30..a9be85d 100644 --- a/Encryption.md +++ b/Encryption.md @@ -179,15 +179,20 @@ Home will receive and interpret the value of this header as real client's address. The address of the reverse proxy server will be received too and also checked against the "trusted" proxies list. +Another header you might want to proxy is the `Host` header, which is required +to make AdGuard Home recognize requests from clients that have a ClientID in +their hostnames. + For example, if the configuration of the reverse proxy server contains the following directives: ```none location /dns-query { - ... + # … + proxy_set_header Host $host; proxy_set_header X-Real-IP '1.2.3.4'; proxy_bind 192.168.1.2; - ... + # … } ``` diff --git a/FAQ.md b/FAQ.md index e40448d..90ea81f 100644 --- a/FAQ.md +++ b/FAQ.md @@ -348,9 +348,10 @@ configuration for your web server: ```none location /aghome/ { + proxy_cookie_path / /aghome/; proxy_pass http://AGH_IP:AGH_PORT/; proxy_redirect / /aghome/; - proxy_cookie_path / /aghome/; + proxy_set_header Host $host; } ```