域名訪問和ip訪問引起的http 403問題

stpeace發表於2017-12-19

        最近遇到了典型的http 403,  來看看:

ubuntu@VM-0-13-ubuntu:~$ curl http://blog.csdn.net | head -n 10
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <script src='/js/tingyun-rum.js?1511847956' type='text/javascript'></script>
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <title>CSDN首页-å…¨çƒæœ€å¤§ä¸­æ–‡IT社区</title>
100  9675    0  9675    0     0  17920      0 --:--:-- --:--:-- --:--:-- 17949
curl: (23) Failed writing body (2613 != 2842)
ubuntu@VM-0-13-ubuntu:~$ 
ubuntu@VM-0-13-ubuntu:~$ 
ubuntu@VM-0-13-ubuntu:~$ 
ubuntu@VM-0-13-ubuntu:~$ 
ubuntu@VM-0-13-ubuntu:~$ 
ubuntu@VM-0-13-ubuntu:~$ 
ubuntu@VM-0-13-ubuntu:~$ 
ubuntu@VM-0-13-ubuntu:~$ 
ubuntu@VM-0-13-ubuntu:~$ ping blog.csdn.net
PING blog.csdn.net (47.95.165.112) 56(84) bytes of data.
64 bytes from 47.95.165.112: icmp_seq=1 ttl=33 time=41.3 ms
64 bytes from 47.95.165.112: icmp_seq=2 ttl=33 time=41.3 ms
64 bytes from 47.95.165.112: icmp_seq=3 ttl=33 time=41.2 ms
^C
--- blog.csdn.net ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 41.272/41.300/41.327/0.022 ms
ubuntu@VM-0-13-ubuntu:~$ ^C
ubuntu@VM-0-13-ubuntu:~$ 
ubuntu@VM-0-13-ubuntu:~$ 
ubuntu@VM-0-13-ubuntu:~$ 
ubuntu@VM-0-13-ubuntu:~$ 
ubuntu@VM-0-13-ubuntu:~$ 
ubuntu@VM-0-13-ubuntu:~$ 
ubuntu@VM-0-13-ubuntu:~$ 
ubuntu@VM-0-13-ubuntu:~$ curl http://47.95.165.112 | head -n 10
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   162  100   162    0     0   1950      0 --:--:-- --:--:-- --:--:--  1975
<html>
<head><title>403 Forbidden</title></head>
<body bgcolor="white">
<center><h1>403 Forbidden</h1></center>
<hr><center>nginx</center>
</body>
</html>
ubuntu@VM-0-13-ubuntu:~$ 
ubuntu@VM-0-13-ubuntu:~$ 
ubuntu@VM-0-13-ubuntu:~$ 
        可見, 能用域名訪問, 但不一定能用ip訪問,  看到那個http 403沒, Forbidden了。




相關文章