禁止主机的IP被恶意解析
导读
你如果是新手还遇到一个情况,你的的网站IP被其他网站绑定了,他会显示我网站的默认界面,他的域名也没有申请SSL,所以还是会链接到我的网站1中
配置文件如下,首先127.0.0.1表示你的服务器IP
添加网站127.0.0.1,不创建数据库和FTP
server { listen 80 default_server; listen 443 http2 ssl default_server; server_name 127.0.0.1; index default2018.php; root /www/wwwroot/127.0.0.1/; return 444; #SSL-START SSL相关配置,请勿删除或修改下一行带注释的404规则 #error_page 404/404.html; limit_conn perserver 300; limit_conn perip 25; limit_rate 512k; #HTTP_TO_HTTPS_START if ($server_port !~ 80){ rewrite ^(/.*)$ http://$host$1 permanent; } #HTTP_TO_HTTPS_END ssl_certificate /etc/letsencrypt/live/127.0.0.1/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/127.0.0.1/privkey.pem; ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; ssl_stapling on; resolver 8.8.8.8 114.114.114.114 valid=3600s; ssl_prefer_server_ciphers on; ssl_stapling_verify on; ssl_dhparam dh2048.pem; ssl_session_cache shared:SSL:10m; ssl_session_timeout 10m; ssl_ciphers "ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA:DES-CBC3-SHA:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!PSK:!RC4"; #SSL-END #ERROR-PAGE-START 错误页配置,可以注释、删除或修改 error_page 404 /404.htm; #ERROR-PAGE-END #REWRITE-START URL重写规则引用,修改后将导致面板设置的伪静态规则失效 include /www/server/panel/vhost/rewrite/127.0.0.1.conf; #REWRITE-END
评论(0)