I am very unfamiliar with nginx, as a forewarning, and also can\'t find any actual references on the regex system they use. So right now it\'s a black box to me.
I made a solution that works. I had it before posting this question but didn't realize I needed to restart nginx. Put the following inside your server block.