Forum: NGINX Condition in location for proxy_pass

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
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" .
This topic is locked and can not be replied to.