I have my server to use Adguard home and Nginx reverse proxy. But it’s only work on my second level subdomain. Now I want to use clientID on AGH, but it need subdomain of current AGH domain.
Example: my domain is example.site, my AGH domain is blockads.example.site, I want to use ID:phone so DoH url is phone.blockads.example.site/dns-query, but when I use this link, it redirect me to blank page (it can’t detect the phone in blockads.example.site)
Nginx config:
events {
worker_connections 768;
# multi_accept on;
}
http{
server_names_hash_bucket_size 64;
upstream adguard-home {
server localhost:8110;
keepalive 64;
server {
listen 80 default_server;
server_name _;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name blockads.hgmusic963.site;
ssl_certificate D:/NetworkServices/Certs/cert.pem;
ssl_certificate_key D:/NetworkServices/Certs/privkey.pem;
ssl_protocols TLSv1.3;
ssl_prefer_server_ciphers off;
ssl_stapling on;
ssl_stapling_verify on;
location /dns-query {
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass https://localhost:8110/dns-query;
}
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass https://adguard-home;
proxy_redirect / /;
proxy_cookie_path / /;
}
}
}
How can I do to use this feature on my domain?
Tấn Hải Trịnh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.