AdguardTeam / AdGuardHome

Network-wide ads & trackers blocking DNS server
https://adguard.com/adguard-home.html
GNU General Public License v3.0
24.88k stars 1.79k forks source link

Async requests with excessively long URLs are causing a blank homepage. #6623

Open yu1t opened 9 months ago

yu1t commented 9 months ago

Prerequisites

Platform (OS and CPU architecture)

Linux, AMD64 (aka x86_64)

Installation

GitHub releases or script from README

Setup

On a router, DHCP is handled by the router

AdGuard Home version

v0.107.43

Action

-

Expected result

-

Actual result

-

Additional information and/or screenshots

When accessing the homepage, the page appears blank. Upon inspecting with developer tools, I discovered a 414 Request-URI Too Large error for the URL /control/clients/find. When using nginx as a reverse proxy and having a large number of clients, GET requests carry a significant amount of query parameters, causing the URL to become excessively long and resulting in an error. Although this can be resolved by modifying the nginx configuration, I believe the issue should be addressed within AdGuard Home itself. GET requests should not carry a large amount of data; otherwise, with a higher number of clients, the URL could become even longer, potentially leading to serious problems. Additionally, querying too much data at once should be avoided to prevent performance issues due to excessively large returned data.

image

realpixelcode commented 8 months ago

I can confirm this behaviour. My NGINX configuration seems to work fine, since the login page loads as expected, but the main dashboard screen is also blank for me. While I didn't explicitly get a 414 error, the browser console did display that a request failed which looked very similar to the one in @yu1t's screenshot, just with IPv4 addresses instead of IPv6 ones.

AGH Nginx

For reference, here are some technical details.

$ uname -a
Linux raspberrypi 6.1.0-rpi6-rpi-v8 #1 SMP PREEMPT Debian 1:6.1.58-1+rpt2 (2023-10-27) aarch64 GNU/Linux

AdGuard Home version: v0.107.43

NGINX configuration for AdGuard Home:

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name adguard.example.com;

    ssl_certificate /etc/letsencrypt/live/adguard.example.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/adguard.example.com/privkey.pem;

    proxy_set_header   X-Real-IP $remote_addr; 
    proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header   Host $host; 

    location / {
        proxy_pass         https://localhost:4443; # this is intentional
        proxy_http_version 1.1;
        proxy_set_header   Upgrade $http_upgrade;
        proxy_set_header   Connection "upgrade";
    }
}

Relevant parts of the AGH configuration:

http:
  address: 0.0.0.0:8087
  session_ttl: 720h
tls:
  enabled: true
  server_name: adguard.example.com
  force_https: true
  port_https: 4443
  port_dns_over_tls: 853
  port_dns_over_quic: 853
  port_dnscrypt: 0
  dnscrypt_config_file: ""
  allow_unencrypted_doh: false
cizordj commented 4 months ago

I can confirm that this is happening to me as well, I'm on Adguard v0.107.26 and I am currently using nginx as a reverse proxy with the following configuration:

location /adg/ {
    proxy_pass http://localhost:3000;
    rewrite ^/adg/(.*)$ /$1 break;
}

Captura de tela de 2024-05-25 22-59-13