Quantcast
Channel: Nginx Forum - Nginx Mailing List - English
Viewing all articles
Browse latest Browse all 7229

Reading request_body before passing to backend server (no replies)

$
0
0
I am trying to read if a specific value is set (passed) as a POST using request_body.

What I am trying to do is:

server {
..
if ($request_body ~ "API-value-Iwanttocheck") {
set $my_api "TRUE";
}

And later on pass to the backend server:

location / {
proxy_pass http://backend:80;
}


However, that never seems to match. I even enabled logging and modified my log_format to have:

"
"POSTREQUEST:$request_body"
"

And I can see in the log when I don't have the if statement. When I add the if statement, it doesn't show up in the logs any more.

Anyone have any idea? Or a simple way to check if a value set via POST is actually there?

Viewing all articles
Browse latest Browse all 7229

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>