AdguardTeam / AdguardTeam/AdGuardHome

DNS Rewrite not working for AdGuard Home itself

Abierto
#7,262 2 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
TypeScript
Estrellas
36.9k
Forks
2.5k
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

### Prerequisites

- [X] I have checked the [Wiki](https://github.com/AdguardTeam/AdGuardHome/wiki) and [Discussions](https://github.com/AdguardTeam/AdGuardHome/discussions/categories/q-a) and found no answer

- [X] I have searched other issues and found no duplicates

- [X] I want to report a bug and not [ask a question or ask for help](https://github.com/AdguardTeam/AdGuardHome/discussions/categories/q-a)

- [X] I have set up AdGuard Home correctly and [configured clients to use it](https://github.com/AdguardTeam/AdGuardHome/wiki/Clients). (Use the [Discussions](https://github.com/AdguardTeam/AdGuardHome/discussions/categories/q-a) for help with installing and configuring clients.)

### Platform (OS and CPU architecture)

Linux, ARMv7

### Installation

GitHub releases or script from README

### Setup

On one machine

### AdGuard Home version

latest

### Action

After setting up successful DNS rewrite for my other services on my machine, I decided to setup a DNS rewrite for AdGuard home itself.

I wrote some domain, I made the target IP Address be the same like the other dns rewrites (i.e the machine IP, which starts with a 10, as it's in the private IP range), I've setup NGINX with literally 1:1 configuration which was completely successful for my other 2 applications, and voyla - after visiting my DNS server, I get a bogus 502 Gateway error.

The nginx configuration I've used for the other 2 applications, including for AdGuard Home, is the following:

```
server {
listen 80;
server_name my.adguard;

# Disable access logging
access_log off;

# Disable error logging (optional)
error_log /dev/null crit;

location / {
proxy_pass http://0.0.0.0:1234; # 1234 is where the web interface for AdGuard home lives, IP binding in .yaml of AdGuardhome is for 10.X.X.X
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;

# Handle WebSocket connections, if any; Yes, I've tried disabling these - same thing.
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
```

The only parts different in this configuration versus the others are obviously - the server_name and the port we forward to.

### Expected result

Things to work.

### Actual result

Things don't work.

### Additional information and/or screenshots

_No response_

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.