Z
zhangce5413

  • Joined Aug 19, 2016
  • https://github.com/firesnow/lua-resty-location-match
    这是实现的模块,你可以参考
    或者有什么更好的方法可以一起学习
    • 我也遇到了这个问题。
      我现在的解决思路是location的个数肯定是有限的,我在已知道所有location规则的情况下,通过当前uri,
      根据nginx的匹配规则获得最符合当前uri的location条件

      On Wednesday, December 14, 2016 at 5:49:39 PM UTC+8, xut...@gmail.com wrote:
      当前一个location配置为

              location /service/ {
                 rewrite_by_lua_block {}
              }

      假如我想在lua中拿到这个location 配置信息,如上配置的"/service/" 是否有响应实现思路或者方法呢呢
      • 找到原因了 请求的域名是被另一个nginx转发到指定ip的,上传过大文件的时候是被域名转发的nginx服务中断了

        On Monday, August 22, 2016 at 10:00:34 AM UTC+8, WenMing wrote:
        你确定两次走的都是同一个端口,同一个 NGINX 服务吗?看第一次返回的是 NGINX,第二次返回的是 openresty

        在 2016年8月19日 下午7:57,策张 <zhang...@gmail.com>写道:
        openresty版本openresty-1.9.15.1.tar.gz

        最开始遇到的问题是

        nginx配置文件设置的是
        client_max_body_size 1G;

        单是上传一个200M的文件的时候就会报413的错误
        <html>
            <head>
                <title>413 Request Entity Too Large</title>
            </head>
            <body bgcolor="white">
                <center>
                    <h1>413 Request Entity Too Large</h1>
                </center>
                <hr>
                <center>nginx/1.9.14</center>
            </body>
        </html>

        而且nginx中没有任何access和error日志

        之后我尝试把client_max_body_size设置为1M 上传一个2M的文件虽然同样会报413单是和上面的错误不太一样
        <html>
            <head>
                <title>413 Request Entity Too Large</title>
            </head>
            <body bgcolor="white">
                <center>
                    <h1>413 Request Entity Too Large</h1>
                </center>
                <hr>
                <center>openresty/1.9.15.1</center>
            </body>
        </html>

        center里面的内容不一样,而且有日志

        ==> ./openresty-file.error.log <==

        2016/08/19 19:56:55 [error] 167975#0: *393 client intended to send too large body: 2376936 bytes, client: 172.16.158.8, server: , request: "POST /callback/bank/upload HTTP/1.0", host: "test.loans.upload-file.t.bbtfax.com"

        ==> ./openresty-file.access.log <==

        172.16.158.8 - - [19/Aug/2016:19:56:55 +0800] "POST /callback/bank/upload HTTP/1.0" 413 607 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36"


        可能是什么原因呢?请求帮助,谢谢。



        --

        • openresty版本openresty-1.9.15.1.tar.gz

          最开始遇到的问题是

          nginx配置文件设置的是
          client_max_body_size 1G;

          单是上传一个200M的文件的时候就会报413的错误
          <html>
              <head>
                  <title>413 Request Entity Too Large</title>
              </head>
              <body bgcolor="white">
                  <center>
                      <h1>413 Request Entity Too Large</h1>
                  </center>
                  <hr>
                  <center>nginx/1.9.14</center>
              </body>
          </html>

          而且nginx中没有任何access和error日志

          之后我尝试把client_max_body_size设置为1M 上传一个2M的文件虽然同样会报413单是和上面的错误不太一样
          <html>
              <head>
                  <title>413 Request Entity Too Large</title>
              </head>
              <body bgcolor="white">
                  <center>
                      <h1>413 Request Entity Too Large</h1>
                  </center>
                  <hr>
                  <center>openresty/1.9.15.1</center>
              </body>
          </html>

          center里面的内容不一样,而且有日志

          ==> ./openresty-file.error.log <==

          2016/08/19 19:56:55 [error] 167975#0: *393 client intended to send too large body: 2376936 bytes, client: 172.16.158.8, server: , request: "POST /callback/bank/upload HTTP/1.0", host: "test.loans.upload-file.t.bbtfax.com"

          ==> ./openresty-file.access.log <==

          172.16.158.8 - - [19/Aug/2016:19:56:55 +0800] "POST /callback/bank/upload HTTP/1.0" 413 607 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36"


          可能是什么原因呢?请求帮助,谢谢。