flyzy博客
分享便宜VPS与网络优惠
搬瓦工

宝塔不装web如何禁止IP访问

装了 nginx之后卸载了  

现在直接访问ip还是会显示

恭喜, 站点创建成功!

情节大佬默认的这个页面配置文件在哪
或者还有其他办法禁止ip访问吗

海南省网友说:/www/server/panel/vhost/cert/default/fullchain.pem —–BEGIN CERTIFICATE—– MIIDITCCAsagAwIBAgIUTcEWLzynkLCFCoAC1iDH2vG3EkYwCgYIKoZIzj0EAwIw gY8xCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1T YW4gRnJhbmNpc2NvMRkwFwYDVQQKExBDbG91ZEZsYXJlLCBJbmMuMTgwNgYDVQQL Ey9DbG91ZEZsYXJlIE9yaWdpbiBTU0wgRUNDIENlcnRpZmljYXRlIEF1dGhvcml0 eTAeFw0xOTAxMTMxNDMxMDBaFw0zNDAxMDkxNDMxMDBaMGIxGTAXBgNVBAoTEENs b3VkRmxhcmUsIEluYy4xHTAbBgNVBAsTFENsb3VkRmxhcmUgT3JpZ2luIENBMSYw JAYDVQQDEx1DbG91ZEZsYXJlIE9yaWdpbiBDZXJ0aWZpY2F0ZTBZMBMGByqGSM49 AgEGCCqGSM49AwEHA0IABAg/hZ9lDHj/f+0jDRAN23TkNEqIi46mCGnwZVD3glxL l+a1mpfXLHSEFTipnSyQgmvkPYzQGaEIFD0q6W/ZgMujggEqMIIBJjAOBgNVHQ8B Af8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwIGCCsGAQUFBwMBMAwGA1UdEwEB /wQCMAAwHQYDVR0OBBYEFCEZF6Eyem01XPbgwr6DXLZV1qsQMB8GA1UdIwQYMBaA FIUwXTsqcNTt1ZJnB/3rObQaDjinMEQGCCsGAQUFBwEBBDgwNjA0BggrBgEFBQcw AYYoaHR0cDovL29jc3AuY2xvdWRmbGFyZS5jb20vb3JpZ2luX2VjY19jYTAjBgNV HREEHDAaggwqLmRuc3BvZC5jb22CCmRuc3BvZC5jb20wPAYDVR0fBDUwMzAxoC+g LYYraHR0cDovL2NybC5jbG91ZGZsYXJlLmNvbS9vcmlnaW5fZWNjX2NhLmNybDAK BggqhkjOPQQDAgNJADBGAiEAnrequCk/QZOOrcPH6C3Hgcy4SPNUy5rQtku/aYkj qQoCIQCN6IyYNiXuwG+8jUgJrveiirBjiz2jXZSTEfVAyibjTg== —–END CERTIFICATE—-复制代码
/www/server/panel/vhost/cert/default/privkey.pem —–BEGIN PRIVATE KEY—– MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgK0HE3hTJQDg6p/fj nS92eSuRKZEZ5F4grT6tWFKNYVmhRANCAAQIP4WfZQx4/3/tIw0QDdt05DRKiIuO pghp8GVQ94JcS5fmtZqX1yx0hBU4qZ0skIJr5D2M0BmhCBQ9Kulv2YDL —–END PRIVATE KEY—–复制代码

/www/server/panel/vhost/nginx/0.default.conf server{ listen 80; listen 443 ssl http2; server_name _; #直接用ip访问时重定向为444 if ( $host ~* “\d+\.\d+\.\d+\.\d+” ) {    return 444; } #配置无效证书 #HTTP_TO_HTTPS_END ssl_certificate    /www/server/panel/vhost/cert/default/fullchain.pem; ssl_certificate_key    /www/server/panel/vhost/cert/default/privkey.pem; ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3; ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE; ssl_prefer_server_ciphers on; ssl_session_cache shared:SSL:10m; ssl_session_timeout 10m; error_page 497  https://$host$request_uri; }复制代码

湖南省网友说:fail2ban 装这个插件可以禁止IP

安徽省网友说:用ip新建一个网站,在网站配置文件中加入return 444;

台湾省网友说:谢谢老哥  没安nginx  得找配置文件

青海省网友说:有没有一种可能,是本地缓存

吉林省网友说:就不能关闭端口吗

赞(0) 打赏
关注我们
未经允许不得转载:flyzy博客 » 宝塔不装web如何禁止IP访问
分享到: 更多 (0)

这是一种鼓励

支付宝扫一扫打赏

微信扫一扫打赏