Posting after x-accel-redirect

dobe nginx-forum at
Sat Mar 6 11:57:14 MSK 2010


use something like below to always have a GET request to your authentication upstream. then let the authentication upstream return an x-accell-redirect header. now if the original request was a post, it will still be a post after the call to the auth upstream. so you could do whatever you want with the authenticated request e.g. send it to another upstream

cheers, bernd

    # internal used for authentication
    location ^~ "/authenticate" {
        proxy_pass http://yourauthbackend;
        proxy_intercept_errors on;
        proxy_method GET;
        proxy_pass_request_body off;
        proxy_set_header  Content-Length  '0';
        rewrite /authenticate(.*) $1;

Posted at Nginx Forum:,60373,60657#msg-60657

More information about the nginx mailing list