일반적으로 유저들은 ip를 통해서 서버에 접속하지 않는다.
그런 일은 거의 없다고 봐도 좋을 것이다.
그렇다면, 굳이 ip로 들어오는 이상한 access까지 허용할 필요가 없다.
Should a website be directly accessible by its IP address?이 글을 보면
From SEO perspective it is a disaster.
If you have one website for example stackexchange.com and it is also accessible from the ip address this will lead to duplicate content.
This will destroy your rankings, and will confuse your users, which they will search Google and find 2 results for the same topic (one accessible by the domain name, and one accessible by the ip address)
Never make a domain accessible from the ip address.
구글 검색을 할 때 두개의 링크가 뜨니까 seo 점수에 좋지 않은 것으로 보인다.
다만, 꼭 필요한가? 라고 한다면 사실 잘 모르겠다.
여러 레퍼런스를 보면 인터넷의 흐름상 ip를 통해 접근하는 게 이상한 것은 아니다. 그런 자연스러운 행동을 차단하는 게 오히려 부자연스럽다는 의견도 있었다.
From a security perspective, it is a smart move.
Most websites with heavy traffic will have a CDN used somewhere. So any attempted DOS or DDOS attack will simply dissipate away through the CDN servers and won't reach the user site.
However, if a user is aware of the site's IP address, he or she can directly fire an attack at the IP and bring down the server in no time. That's why most CDNs will offer you options to hide your server's IP addresses. So giving a 404 to someone who is trying to access the site is a good move. It can be wither done by a .htaccess file or by hosting the site at a place other than the default server
보안의 관점에서 볼 때, 대부분의 IP를 안다면 이를 직접적으로 공격해서 서버를 해킹하려고 할 수 있다. 그래서 대부분의 CDN이 IP를 가리는 옵션을 제공한다고 한다.
내 경우에는
IP를 통해서 자꾸 이런 무차별적인 공격이 들어온다. 상당히 많이 들어오는 탓에 여기에 들어가는 리소스도 어느정도 있을 것으로 보인다.
그래서, 우선 서버 IP 접근을 차단하고 DNS 문제가 있을 때 잠시 풀어서 디버깅을 하는 방식을 쓰려고 한다.
공식문서에 설정 방법이 나온다.
이 설정을 넣어주면 된다. 서버 네임을 저렇게 하지않으면 이름이 없다고 설정 오류가 뜬다.
443을 넣지 않은건 어차피 https는 ip기반으로는 작동 안해서 도메인으로 접속해야 하기 때문에 80포트만 ip접근을 막았다.