I\'m setting up nginx and I need to use the location directive to match all requests that begin with /site1 AND end with .php. What regex do I use to d
You want this: ^(/site).*(\.php)$. This means that first you match the beginning followed by "/site", then anything any number of times, and finally ".php" followed by the end of the string. If you don't need the captures, it would be simpler as: ^/site.*\.php$.