ingress-nginx 使用 IP 访问 404,域名访问正常

Cyshall:RT,是 ingress-nginx 本身就是这样,还是说有相关配置可以更改。

以下是 nginx 相关配置:

nginx.conf

user  nginx;
worker_processes  1;

error_log  /var/log/nginx/error.log warn;
pid        /var/run/nginx.pid;


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;

    sendfile        on;
    #tcp_nopush     on;

    keepalive_timeout  65;

    #gzip  on;

    include /etc/nginx/conf.d/*.conf;
}

/etc/nginx/conf.d/default.conf

server {
    listen       80;
    server_name  localhost;

    #charset koi8-r;
    #access_log  /var/log/nginx/host.access.log  main;

    location / {
        root   /usr/share/nginx/html;
        index  index.html index.htm;
    }

    #error_page  404              /404.html;

    # redirect server error pages to the static page /50x.html
    #
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }

    location = /hostname.html {
        alias /etc/hostname;
    }

    # proxy the PHP scripts to Apache listening on 127.0.0.1:80
    #
    #location ~ \.php$ {
    #    proxy_pass   http://127.0.0.1;
    #}

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    #
    #location ~ \.php$ {
    #    root           html;
    #    fastcgi_pass   127.0.0.1:9000;
    #    fastcgi_index  index.php;
    #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
    #    include        fastcgi_params;
    #}

    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one
    #
    #location ~ /\.ht {
    #    deny  all;
    #}
}

halfcrazy:取决你的 ingress 的配置。ingress 里配了 host,那么访问必须带 houst 。没配 host 的话,域名 ip 都可以

前端实时检测一些异常访问 IP,然后通过 nginx 来阻止这些 ip 访问, blocked_IPs 通过什么方式存储比较好?

miniyao:目前是前端检测到异常访问 IP,直接存数据库,然后在业务层拒绝访问。现在想把这个拦截前置到 nginx,就是这个 blocked_IPs 用什么方法给到 nginx 呢?一般这个 blocked_IPs 会一周之后释放,不再拦截,因此考虑每天更新一下,能不能不重启 nginx 实现?dilu:最主流的肯定 redis 啦 用 lua 还能直接…

单位有几台闲置的服务器,也有几条专线 IP

QingquanBaby:有没有办法,可以将这些服务器用起来,恰个早餐啥的呢? 某站有个开代理,嵌入广告的办法,感觉可行,就是手段有点(***) 烦请大神不吝赐教。

电信更换公网 IP,无线路由器重启后,公网 IP 又变成内网 IP 了,如何解决啊?

rimworld:打 10000 请求更换了公网 IP,但是只是公网 IP5 分钟体验版,我为了测试公网 IP 是否一直给,重启了下无线路由器(无线路由器为拨号上网模式,光猫应为桥接模式),然后惊喜的发现 IP 又变成电信的内网地址了。难道要和电信客服无限撕逼,每次都要申请更换公网 IP 吗?我觉得是我小区这边的电信维修人员故意没有设置好吧?flyfishc…

请问各位,百度产品网站对 ip 地址的访问记录记录保存多久

didi1717:百度对 ip 地址的访问记录保存多久呢,疫情前的事打官司,想通过法院调取网络日志中的“来访 ip 地址的保存记录”,《网络安全法》要求 6 个月,不知道百度会不会保管的更长时间,谢谢各位。

请教有无软路由能满足分流国内外 IP/网站的需求

matthewlien:如题,目前有购买软路由的欲望,想用软路由做这样一个事情:①中国大陆的 IP 走 WAN1②非中国大陆 IP 地址一律放行到 WAN2 。我知道这个事情需要路由表去实现,但不知道现在的软路由提供的分流功能是否足够强大到能实现这个需求呢?感谢赐教的各位。liuxyon:opnsense matthewlien:@liuxyon 谢谢,我查…