Is it possible to configure Nginx to return the body of the response created from the request header or request parameter? It looks like it can be done using the echo module, but if possible, I would like to do it using the Nginx vanilla installation.
Basically I want to do the following, but obviously return_body does not exist, so what can I use instead?
location ~* ^/echo/(.+) { return_body $1; }
or
location /echo_user_agent { return_body $http_user_agent; }
If I install the echo module, I could replace return_body with echo , but if at all possible, it would be nice to be able to do this without installing any additional functions, it seems to me that something kind of simple, like this, you can do without .
source share