这些小活动你都参加了吗?快来围观一下吧!>>
电子产品世界 » 论坛首页 » 嵌入式开发 » STM32 » 域名访问和ip访问引起的http 403问题

共2条 1/1 1 跳转至

域名访问和ip访问引起的http 403问题

高工
2017-12-21 11:47:52     打赏

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


[plain] view plain copy

  1. ubuntu@VM-0-13-ubuntu:~$ curl http://blog.csdn.net | head -n 10  

  2.   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current  

  3.                                  Dload  Upload   Total   Spent    Left  Speed  

  4.   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0<!DOCTYPE html>  

  5. <html lang="en">  

  6. <head>  

  7.     <meta charset="utf-8">  

  8.     <script src='/js/tingyun-rum.js?1511847956' type='text/javascript'></script>  

  9.     <meta http-equiv="content-type" content="text/html; charset=utf-8">  

  10.     <meta http-equiv="X-UA-Compatible" content="IE=Edge">  

  11.     <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">  

  12.     <meta name="apple-mobile-web-app-status-bar-style" content="black">  

  13.     <title>CSDN首页-å…¨çƒæœ€å¤§ä¸­æ–‡IT社区</title>  

  14. 100  9675    0  9675    0     0  17920      0 --:--:-- --:--:-- --:--:-- 17949  

  15. curl: (23) Failed writing body (2613 != 2842)  

  16. ubuntu@VM-0-13-ubuntu:~$   

  17. ubuntu@VM-0-13-ubuntu:~$   

  18. ubuntu@VM-0-13-ubuntu:~$   

  19. ubuntu@VM-0-13-ubuntu:~$   

  20. ubuntu@VM-0-13-ubuntu:~$   

  21. ubuntu@VM-0-13-ubuntu:~$   

  22. ubuntu@VM-0-13-ubuntu:~$   

  23. ubuntu@VM-0-13-ubuntu:~$   

  24. ubuntu@VM-0-13-ubuntu:~$ ping blog.csdn.net  

  25. PING blog.csdn.net (47.95.165.112) 56(84) bytes of data.  

  26. 64 bytes from 47.95.165.112: icmp_seq=1 ttl=33 time=41.3 ms  

  27. 64 bytes from 47.95.165.112: icmp_seq=2 ttl=33 time=41.3 ms  

  28. 64 bytes from 47.95.165.112: icmp_seq=3 ttl=33 time=41.2 ms  

  29. ^C  

  30. --- blog.csdn.net ping statistics ---  

  31. 3 packets transmitted, 3 received, 0% packet loss, time 2003ms  

  32. rtt min/avg/max/mdev = 41.272/41.300/41.327/0.022 ms  

  33. ubuntu@VM-0-13-ubuntu:~$ ^C  

  34. ubuntu@VM-0-13-ubuntu:~$   

  35. ubuntu@VM-0-13-ubuntu:~$   

  36. ubuntu@VM-0-13-ubuntu:~$   

  37. ubuntu@VM-0-13-ubuntu:~$   

  38. ubuntu@VM-0-13-ubuntu:~$   

  39. ubuntu@VM-0-13-ubuntu:~$   

  40. ubuntu@VM-0-13-ubuntu:~$   

  41. ubuntu@VM-0-13-ubuntu:~$ curl http://47.95.165.112 | head -n 10  

  42.   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current  

  43.                                  Dload  Upload   Total   Spent    Left  Speed  

  44. 100   162  100   162    0     0   1950      0 --:--:-- --:--:-- --:--:--  1975  

  45. <html>  

  46. <head><title>403 Forbidden</title></head>  

  47. <body bgcolor="white">  

  48. <center><h1>403 Forbidden</h1></center>  

  49. <hr><center>nginx</center>  

  50. </body>  

  51. </html>  

  52. ubuntu@VM-0-13-ubuntu:~$   

  53. ubuntu@VM-0-13-ubuntu:~$   

  54. ubuntu@VM-0-13-ubuntu:~$   

        可见, 能用域名访问, 但不一定能用ip访问,  看到那个http 403没, Forbidden了。




专家
2017-12-22 08:56:37     打赏
2楼

谢谢楼主分享经验。


共2条 1/1 1 跳转至

回复

匿名不能发帖!请先 [ 登陆 注册 ]