aidevs
V2EX  ›  问与答

nginx lua 可以访问 http 地址么?

  •  
  •   aidevs · May 8, 2017 · 1821 views
    This topic created in 3376 days ago, the information mentioned may be changed or developed.
    假设有 nginx 站点,域名为:nginx.net

    当请求地址 http://nginx.net/abc/test_123.html 的时候

    服务器端同时访问一下 http://tongji.com/abc/api/tongji.do?id=123,不输出内容

    同时还要正常输出 http://nginx.net/abc/test_123.html 的内容

    但是 lua 脚本不太会写,不知道能实现不?
    4 replies    2017-05-08 14:14:14 +08:00
    Jaylee
        1
    Jaylee  
       May 8, 2017
    可以实现
    Jaylee
        2
    Jaylee  
       May 8, 2017   ❤️ 1
    通过 lua-resty-http 这个库实现
    Tinet
        3
    Tinet  
       May 8, 2017
    可以实现
    Daniel65536
        4
    Daniel65536  
       May 8, 2017 via iPad   ❤️ 1
    Nginx 自带这个功能,都不用上 lua 啊……

    具体说明可以看 https://darknode.in/network/nginx-google-analytics/
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   977 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 19:23 · PVG 03:23 · LAX 12:23 · JFK 15:23
    ♥ Do have faith in what you're doing.