Skip to content
Changelog
new tooldeveloper-web

Nginx Redirect Generator

v1.0

Nginx Redirect Generator turns a bulk list of old paths and new URLs into redirect rules for nginx.conf. Paste one pair per line, separated by whitespace or a comma.

Input is forgiving: a full origin on the old side is cut down to a path, and the target can be a full URL or a site-relative path. The output is checked line by line. Lines it can't read, invalid paths and duplicate sources are listed with their line number. Values that need quoting in nginx, like those with a semicolon, brace or space, are quoted and escaped for you, and a value containing $ is rejected because nginx would treat it as a variable. Redirect loops, including multi-hop ones, are flagged, while a chain that ends on another host is left alone.

Choose one location = block per redirect, or a single map $request_uri block for larger sets (suggested past twenty redirects). Query strings on the old path are rejected in location style, which matches only the path, and accepted in map style. Sample loads a working example. Share puts the list, status code and output style in a link, up to forty redirects, and beyond that you can download the config. Everything runs in your browser.

All changes