Назад | Перейти на главную страницу

Привязать запись с подстановочными знаками, захватывающую все неопределенные (NXDOMAIN) домены, а не только из локальной зоны, но только для curl, wget, chrome и т. Д.

Моя установка перенаправляет неопределенные хосты в локальной сети на настраиваемую страницу 404; Таким образом, для invalidhostname.subdomain.example.com в bind9 сервер перенаправит на nginxProxy.subdomain.example.com. (который сам перенаправляет на страницу 404, размещенную на другом сервере)

Он работает, как ожидалось, для локальных неопределенных имен хостов.

Но когда дело доходит до askljdaksjdad.com, nslookup,host,dig все правильно вернуть NXDOMAIN, но google-chrome, curl и wget все доставляют настраиваемую страницу 404 из моего поддомена. И это происходит на нескольких Linux-машинах в сети.

Соответствующие части файлов конфигурации:
на сервере привязки:/etc/bind/zones/forward.subdomain.example.com

subdomain.example.com       IN SOA  bind01.subdomain.example.com. nitin.subdomain.example.com (
                64         ; serial
                604800     ; refresh (1 week)
                86400      ; retry (1 day)
                2419200    ; expire (4 weeks)
                604800     ; minimum (1 week)
                )
            NS  ns02.subdomain.example.com.
            NS  bind01.subdomain.example.com.
$ORIGIN subdomain.example.com.
;*                  CNAME   nginxProxy
*.subdomain.example.com.    CNAME   nginxProxy
nginxProxy          A   192.168.1.200

на nginxProxy:/etc/nginx/conf.d/default.conf

server {
# Server:port pair that this instance of nginx is running on and should listen to for incoming connections(IP address or name)
# Add "default_server" before the end of the line if this is the default server/role
    listen       nginxProxy.subdomain.example.com:80;

# Set name of the virtual server
    server_name subdomain.example.com *.subdomain.example.com www.subdomain.example.*;

# Address of target/upstream VM/server that hosts the actual service.
    set $target http://web.subdomain.example.com:8080/404/error.html;

# Location configuration
    location / {
# resolver directive needed here if using variables with server names for proxy_pass directive; as nginx doesn't like calling the unix resolver after configuration.
    resolver 192.168.1.210;
    proxy_pass $target;
    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_http_version 1.1;
    proxy_set_header Connection "";
    proxy_buffering off;
    client_max_body_size 0;
    proxy_read_timeout 36000s;
    proxy_redirect off;
    }
}

Так что мне здесь не хватает ?? Это не ожидаемое поведение, правда?