V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
OpenWrt 是一个专门面向嵌入式设备的 Linux 发行版。你可以将 OpenWrt 支持的型号的嵌入式设备,比如各种路由器上的系统,换成一个有更多可能性可以折腾的 Linux 系统。
OpenWrt 官方网站
ochatokori
V2EX  ›  OpenWrt

请教大佬们, op 上 nginx 读取不到/proc/net/arp 内容的问题

  •  
  •   ochatokori · 23 天前 via Android · 421 次点击
    固件是官方 openwrt ,nginx 是 root 启动的,请求/proc/net/arp 会返回一个 content-length 为 0 的 200 响应,而不是找不到文件的 404 ,有人知道是什么问题么?是因为 proc 这个目录特殊还是?或者说有什么除拷贝一个出来之外的办法能让 nginx 返回这个 arp 表吗



    ```bash

    location /download/procnet {

    alias /proc/net/;

    }

    ```



    ```bash

    ➜ ~ curl https://xxx.xxx/download/procnet/arp -I

    HTTP/1.1 200 OK

    Server: nginx

    Date: Sat, 25 May 2024 13:06:14 GMT

    Content-Type: application/octet-stream

    Content-Length: 0

    Last-Modified: Sat, 25 May 2024 13:06:14 GMT

    Connection: keep-alive

    ETag: "6651e246-0"

    Accept-Ranges: bytes

    ```



    请求一个不存在的文件的话会返回 404
    1 条回复    2024-05-26 12:41:26 +08:00
    mohumohu
        1
    mohumohu  
       22 天前
    如果你尝试 ls /proc/net/arp -lah ,你会发现他的大小就是 0 ,他是一个虚拟文件。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2705 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 15:00 · PVG 23:00 · LAX 08:00 · JFK 11:00
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.