Passing small request_body to auth_request through a header

Danomi Czaski djczaski at
Wed Apr 26 14:42:14 UTC 2017

I have a small body (less than 512 bytes) that I'd like to pass to
auth_request. Since the body is discarded, I've tried passing it
through a header with no luck. Is there any way to do this?

    location = /my_auth

        include  fastcgi_params;
        fastcgi_pass  unix:/tmp/nginx/sock/my_auth.sock;

        proxy_pass_request_body off;
        proxy_set_header Content-Length "";

        proxy_set_header MYBODY $request_body;
        fastcgi_param  MYBODY $request_body;

    location = /login
        auth_request /my_auth;
        client_max_body_size 512;

More information about the nginx mailing list