xxoxx
V2EX  ›  问与答

服务器上删除了 robots.txt,但是远程还能访问到这个文件是怎么回事?

  •  
  •   xxoxx · Mar 11, 2024 · 3697 views
    This topic created in 974 days ago, the information mentioned may be changed or developed.

    朋友在内网用 iis 搭了一个网站,因为 robots.txt 记录了几个敏感目录,于是删除了 robots.txt ,现在本地无法访问 robots.txt ,但是内网其它主机还是可以访问到这个文件。怎么才能让这个文件永久消失呢?

    17 replies  •  2024-03-11 14:49:24 +08:00
    aeron
    aeron
    Mar 11, 2024
    1
    robots 是君子协定,只是告诉别人哪里可以爬哪里不可以爬,别人是否遵守在于他自己。想永久让他消失删了不就行了
    python35
    python35
    Mar 11, 2024
    2
    可以访问是因为浏览器缓存吧?在可以访问的主机上换一个浏览器 或者浏览器 f12 禁用缓存试试
    xxoxx
    xxoxx
    OP
    Mar 11, 2024
    3
    @aeron iis 服务器上已经删除了 robots.txt ,本地已经无法访问,但是其它主机还是能访问,顺便说一下:没有做负载均衡
    gregy
    gregy
    Mar 11, 2024
    4
    是不是浏览器缓存?用浏览器隐私模式访问,或者清空浏览器缓存再试试,或者用 curl 访问一下试试
    xxoxx
    xxoxx
    OP
    Mar 11, 2024
    5
    @python35 从其它主机访问的已经做过清楚浏览器缓存的动作,但是还是能访问
    300
    300
    Mar 11, 2024
    6
    iis 不知道,nginx 好像是开启了 sendfile (不记得是不是这个了),有个缓存在本地。文件怎么改都不生效,让我一通好找
    xxoxx
    xxoxx
    OP
    Mar 11, 2024
    7
    @gregy 浏览器缓存已经清除,用 curl 还是能返回 robots.txt 文件的内容
    nothingistrue
    nothingistrue
    Mar 11, 2024
    8
    人家缓存到本地的,你还想删?
    ZeekChatCom
    ZeekChatCom
    Mar 11, 2024
    9
    浏览器缓存、服务器端缓存、cdn 缓存
    nothingistrue
    nothingistrue
    Mar 11, 2024
    10
    浏览器缓存排除了,那就找 IIS 缓存。这种情况,基本都是缓存造成的。

    还有一种极端情况,有些中间件(主要是 Java 早期那些需要部署 WAR/webapp 的,IIS 应该没有这种情况),会选择不动原始文件而是将其复制到工作区再用,这时候要去清理工作区。
    gregy
    gregy
    Mar 11, 2024
    11
    会不会存在一种可能,是 OP 找错了路径,删错了文件。。。
    coderJie
    coderJie
    Mar 11, 2024
    12
    一种可能,文件只是假删除了,得清空回收站
    xxoxx
    xxoxx
    OP
    Mar 11, 2024
    13
    @nothingistrue
    @ramirezyolis808
    @nothingistrue
    @gregy
    @coderJie
    @winterbells
    奇怪的是把 iis 停了后,本地无法访问,其它主机还是能访问,查看 80 端口的进程是 system ,pid 是 4 ,理论上 iis 停了 80 端口应该是无法联通的,但是 telnet 80 端口还是有返回。有点头大了?
    gleox
    gleox
    Mar 11, 2024
    14
    你可能用了 URL 保留功能,执行下面命令,看看有没有监听 80 端口的 URL
    netsh http show urlacl
    gleox
    gleox
    Mar 11, 2024
    15
    保留 URL 功能也可以调用 http.sys(system pid 4)开启 80 端口监听的
    Tink
    Tink
    Mar 11, 2024❤️1
    16
    有些 web 服务是自带 robots 啊,如果你本地有他就用你的,如果没有他会默认生成一个
    DawnMoon
    DawnMoon
    Mar 11, 2024
    17
    有没有可能,你的服务器上还有另一个 web 服务,你删的位置不对
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1019 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 22:42 · PVG 06:42 · LAX 14:42 · JFK 17:42
    ♥ Do have faith in what you're doing.