Managing Redirects on Nginx-Hosted Domains
Need to redirect some specific URLs while also catching all other traffic with a wildcard redirect? Nginx works differently than Apache, and you may need server-level configuration to do both.
The Difference
On Apache, you’d use .htaccess files. On Nginx, redirects are managed in the server configuration file. This matters when you need both exact-match redirects AND wildcard (catch-all) redirects at the same time.
What You’re Trying to Do
You probably need:
- Exact redirects — Specific old URLs go to specific new pages
- Wildcard redirects — Everything else from the old domain goes to a catch-all landing page
How to Set It Up
1. List your exact redirects
Identify which specific URLs need to redirect where:
/old-page-1 → https://newdomain.com/new-page-1
/old-page-2 → https://newdomain.com/new-page-2
/contact → https://newdomain.com/contact-us
2. Define your wildcard destination
Where should everything else go?
/* → https://newdomain.com/landing-page
3. Check Scout
Some redirect tools in Scout can handle this, but not always. If Scout doesn’t support combining exact and wildcard redirects, you’ll need Nginx-level configuration.
4. Request server-level redirects
Contact cloudabove.com/contact-us and provide:
- The exact URL redirects you need (with source and destination)
- The wildcard destination for unmatched requests
- The old domain name(s)
We’ll add them to your Nginx configuration.
5. Test both redirect types
Once deployed, test:
- One of your exact-match redirects (should go to the specific new page)
- A random URL on the old domain (should hit the wildcard destination)
Why This Matters
Exact-match redirects must be checked before wildcard redirects, or every request would hit the catch-all and your specific redirects would never trigger. Nginx configuration handles this priority automatically.
Exact redirects first, wildcard catch-all second. This combination preserves specific pages while cleaning up everything else.