Just add a location block prior to where you're hitting your first php block. The order of location blocks matters. I believe regex takes precedence and the more refined one also takes more precedence. This means that a location block prior to handle this will keep that from happening.