nginx conditional proxy pass based on request body content

前端 未结 2 1094
再見小時候
再見小時候 2021-02-19 17:08

I am trying to configure nginx to proxy pass the request to another server, only if the $request_body variable matches on a specific regular expression.But it is not working for

2条回答
  •  不思量自难忘°
    2021-02-19 18:03

    As best I can tell the issue is that the variable $request_body may not have been read into memory at the time your if statement is executing.

    Suggested alternatives would be to use the lua support or compile nginx with the echo modules and run echo_request_body.

提交回复
热议问题