Nginx Redirect Generator
Turn a list of old and new paths into nginx location blocks that return a redirect. Choose the status code and whether each old path must match exactly or as a prefix.
1 Paste your text and pick the options
2 Your answer
Your answer shows here as you type.
How to use the Nginx Redirect Generator
- Enter one redirect per line: the old path, a space, then the new path or full URL.
- Pick the status code. Use 301 for permanent moves and 302 for temporary ones.
- Choose exact match for one path only, or prefix match to redirect everything that starts with the path. Paste the output into a server block and run nginx -t before reloading.
Frequently asked questions
What is the difference between a 301 and a 302 redirect?
A 301 tells browsers and search engines the move is permanent, so search ranking usually passes to the new URL. A 302 means the move is temporary and the original URL should stay in the index.
What does location = mean in nginx?
The equals sign makes the location an exact match, so it only applies when the request path is identical to the given path. Without it, nginx matches any request that starts with the path.
Where do I put these redirects?
Place the location blocks inside the server block for your domain in the nginx site configuration, then run nginx -t to check the syntax and nginx -s reload to apply it.
Wrote something with AI? Slop Monkey rewrites it so it sounds like you, and keeps your facts.