Matching multiple endpoints in location of nginx.conf

keeyong nginx-forum at nginx.us
Sun Nov 23 20:51:50 UTC 2014


I can't really test this easily so I am asking instead. I have this location
statement in my nginx.conf:

        location ~* ^/(api/abcd)/ {
            ...
        }

Now I want to match against "api/efgh". Then the regex should be something
like this?

        location ~* ^/(api/(abcd|efgh))/ {
            ...
        }

OR

        location ~* ^/api/(abcd|efgh)/ {
            ...
        }

OR

something else?

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,255057,255057#msg-255057



More information about the nginx mailing list