Nginx exact redirect rules generator
Convert a source,target CSV into exact-path Nginx location and return rules, checking duplicate sources and same-site loops.
- 1Add input
- 2Adjust settings
- 3Get your result
Tool input and files are processed in this browser without being uploaded.
Before you start
Use a CSV headed source,target to generate exact-path location blocks with return 301 or 302. Start source paths with / and enter absolute target URLs. This output is not an Nginx map directive.
How to use this tool
- Enter a CSV headed source,target; source is a slash-prefixed path and target is an absolute URL.
- Open Settings to choose 301 or 302. The site origin is used to check same-site loops.
- Review the path, status code and target preview; download the full .conf, place its blocks inside your server block, and test with nginx -t before reload.
Supported inputs and limits
Generates location blocks for a server context, not an Nginx map directive. A source path matches regardless of incoming query; each target URL is fixed. Review existing location conflicts and test with nginx -t before reload. This tool does not run nginx -t, test the intended site or deploy the configuration.
Files and input stay in the browser. Paste and UTF-8 CSV files are each limited to 1 MiB; at most 1,000 rules. Outputs do not overwrite original files.
Provide complete source paths and fixed absolute target URLs; the generator does not expand a CSV into dynamic runtime rules.
Worked example
Example input
source,target /old,https://example.com/new
Example options
{"origin":"https://example.com","redirectStatus":"301"}Example output
location = /old { return 301 https://example.com/new; }When something does not work
Fix CSV headers and rows, duplicate source paths, invalid origin or same-site loops, then regenerate. Test the downloaded blocks with nginx -t inside your server configuration.
Frequently asked questions
Are duplicate sources and redirect loops checked?
Duplicate source paths and loops within the supplied map are rejected for the current site origin. Test conflicts with existing configuration separately.
What should the example produce?
Review location = /old and its absolute target. A /new → /old entry on this origin must be rejected as a loop.
Which cases are outside its scope?
This generates exact-path location blocks, not an Nginx map. Incoming queries do not select different rules. It cannot check existing location conflicts or your running server.
Documentation & further reading
Related tools
QR code maker
Turn a link or a little text into a QR code.
UTM link builder
Add your campaign details without the guesswork.
Meta tags generator
Fill in page details and copy the resulting meta tags.
robots.txt generator
Build a robots.txt file from the crawl rules you choose.