Forum: NGINX Condition in location for proxy_pass

79c330896eea5cf1233c35ea19f2cbd6?d=identicon&s=25 trm asn (Guest)
on 2012-10-17 11:46
(Received via mailing list)
Dear List ,

I need to do a conditional proxy_pass , but it's not happening as


set $target

And that $target , I would like to check with $request_uri in below

location /sso/ {
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For
                proxy_set_header Host $http_host;
                proxy_redirect off;
                if ($target ~ $request_uri) {
               else {
                        return 403;

Is that possible achieve inside "location" for "proxy_pass" .
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.