Nginx Redirect Generator
Build Nginx
server {} block redirect config. Supports exact-match rewrites, regex rewrites, HTTPS and www canonicalisation. Add rules one by one or paste a CSV.
Technical SEO Intelligence
Nginx redirects are faster than .htaccess but easier to misorder.
Unlike Apache, Nginx evaluates
location blocks by specificity rules you have to know. Catch-all return statements inside the wrong location break specific redirects. This tool generates correctly-ordered blocks and a safe default placement inside the server {}.
Global rules
Individual redirects
Or paste a bulk CSV
Generated Nginx config
Place inside your server {} block (or server {} on :80 for HTTPS forcing)
Next steps
Verify every redirect works after deploy
Reload Nginx with
nginx -s reload and spot-check each redirect in a browser's DevTools Network tab. Watch for 302s that should be 301s.Frequently asked questions
Where do Nginx redirects go?
Inside server blocks in
/etc/nginx/sites-enabled/ or /etc/nginx/conf.d/. Nginx has no per-directory config file like .htaccess.How do I force HTTPS in Nginx?
Return a 301 from the port-80 server block:
return 301 https://$host$request_uri;What is return vs rewrite in Nginx?
return is a one-shot response (fastest). rewrite changes the URI and optionally returns. Use return for permanent redirects.Do I need to reload Nginx after changes?
Yes.
nginx -s reload or systemctl reload nginx after editing config.How do I handle regex redirects?
rewrite ^/old/(.*)$ /new/$1 permanent;: the backreference preserves the matched segment.What is permanent vs redirect in rewrite?
permanent issues 301, redirect issues 302. Default is 302 if omitted.Can I include a long redirect map?
Yes. Use the
map directive to look up thousands of URL mappings efficiently. Faster than many individual rules.Does Nginx support regex in server_name?
Yes, prefix with
~. Useful for wildcard subdomain handling.How to redirect without domain change?
Use
$request_uri only in the return statement, keep the host as $host.How to test an Nginx config?
nginx -t dry-runs the config without applying. Always run before reloading.Can Cloudflare do this instead?
Yes. Cloudflare Bulk Redirects move the logic to the edge, offload the server, and support the same patterns.
Free · no account
SEORCE for Chrome, Edge and Firefox
Audits the page you are on: headings, meta tags, schema, indexability, and whether AI crawlers can read it. Export the result as a PDF. Free, with no account.
It audits one page at a time and does not track AI answers. About the extension
Across the whole site
One check here. Every page in SEORCE.
This tool does one job. SEORCE Technical Suite crawls your whole site with fast and secure crawlers and ranks technical issues by impact. AutoFix applies fixes for meta tags, schema, canonical tags, image alt text, headings and internal links for orphan pages on your live site, through one script tag, and the list keeps growing.
3,000+ users · Free forever plan, no card needed