AdguardTeam / AdguardTeam/AdGuardHome

DNS Rewrite not working for AdGuard Home itself

Đang mở
#7,262 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
TypeScript
Star
36.9k
Fork
2.5k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

### 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_

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.