####apache配置方法 修改http.conf
<VirtualHost *:80>
ServerName IP地址
<Location />
Order Allow,Deny
Deny from all
</Location>
</VirtualHost>
####nginx配置方法 修改nginx.conf #####80端口
server {
listen 80 default_server;
rewrite_log on;
server_name _;
access_log /home/www/default_access.log access;
error_log /home/www/default_error.log notice;
return 444;
}
#####443端口
server {
listen 443 default_server;
ssl on;
rewrite_log on;
server_name _;
access_log /home/www/default_ssl_access.log access;
error_log /home/www/default_ssl_error.log notice;
ssl_certificate /usr/local/nginx/ssl/1_test.crt; #这两行必须配置,不然会导致其他正常443站点无法访问
ssl_certificate_key /usr/local/nginx/ssl/2_test.key; #这两行必须配置,不然会导致其他正常443站点无法访问
return 444;
}
评论区