Neatbo.

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.

Browser-local processingInputFile / TextOutputNginx configurationUp to 1 MiB per file · File limit: 1
  1. 1Add input
  2. 2Adjust settings
  3. 3Get your result

Tool input and files are processed in this browser without being uploaded.

Your input

Inputs are kept temporarily in this tab when switching tools. Refreshing or closing clears them; large results may need to be regenerated.

⌘ / Ctrl + Enter to run
Delimited text source
0 characters · 0 bytes
Options

Complete the required options first. You can keep the defaults for the rest.

Use 301 for a permanent move or 302 for a temporary redirect.

Enter the scheme and host, such as https://example.com, to check redirects within the same site.

Preparing the tool…

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

  1. Enter a CSV headed source,target; source is a slash-prefixed path and target is an absolute URL.
  2. Open Settings to choose 301 or 302. The site origin is used to check same-site loops.
  3. 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