Here is my regex for NGINX:
location ~ ^/[0-9a-z_]{1,} { }
It is supposed to work for all cases of example.com/*, so has to be at least 1 character.
example.com/*
The {1,} is causing it to be invalid however, it works without it though
{1,}