There are two major no-nos when it comes to writing NGINX redirects:
- thou shalt not use
if statements(that’s a major no-no);
- thought shalt not use
rewrites(they are a waste of resources, as in “slow” and “expensive”).
Instead, use ol’ good location blocks. But what if you have plenty of URIs to redirect? How do you deploy RegEx magic with NGINX? Easy.