
大家都有遇到过可以通过ip直接访问网站,这样理论上不利于SEO的优化。
所以我们希望可以避免直接用IP访问网站,而只能通过域名访问。
具体怎么做呢,看下面。
官方文档中提供的方法:
If you do not want to process requests with undefined "Host" header lines, you may define a default server that just drops the requests:
server {
listen 80 default_server;
server_name _;
return 444...