events { worker_connections 1024; } http { include /etc/nginx/mime.types; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; error_log /var/log/nginx/error.log; sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; # 默认站点 - AdWireGuard管理面板 server { listen 80; server_name localhost; root /usr/share/nginx/html; index index.html; # 静态文件 location / { try_files $uri $uri/ /index.html; } # AdGuard Web UI代理 location /adguard/ { proxy_pass http://10.99.99.1:3000/; 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; } # WireGuard配置下载 location /wireguard/ { alias /config/peer_configs/; autoindex on; autoindex_exact_size off; autoindex_localtime on; } } }