Nginx Redirect Generator
Create Nginx 301/302 page redirects plus HTTP → HTTPS and www / non-www rules.
Page redirects
Paths must start with /. Spaces, quotes, braces and semicolons are not allowed.
Protect SEO during site migrations
When you change your URL structure, merge pages or move to a new domain, 301 redirects pass visitors and search engine signals from old addresses to new ones. The Nginx Redirect Generator prepares these rules without mistakes.
Generated rules
- Per-page 301 or 302 redirects
- HTTP to HTTPS redirect
- www to non-www, or the other way round
Fast, safe configuration
Each redirect becomes an exact-match location block using return, which is fast and avoids regex surprises. Paths are validated so unsafe characters can't break the generated configuration.
How to use Nginx Redirect Generator
- Add old and new URL pairs.
- Choose the redirect type (301 or 302).
- Enable the HTTPS and www rules as needed.
- Add the config to your server block and test with nginx -t.
Why use this tool?
Create redirects that prevent ranking loss during migrations, without configuration errors.
FAQ
Should I use 301 or 302?
Use 301 (or 308) for permanent moves so search engines pass rankings along. Use 302 (or 307) for temporary situations.
Where should I add the configuration?
Inside the relevant server block; then test the syntax with nginx -t and reload.
Why are redirect chains bad?
Chains like A → B → C slow pages down and can lose signals; redirect old addresses straight to the final destination.
Related tools
.htaccess Redirect Generator
Create Apache .htaccess page-level 301/302 rules plus HTTP → HTTPS and www / non-www redirects.
Open toolSecurity Headers Generator
Create CSP, HSTS, Referrer-Policy, Permissions-Policy and other headers for Nginx, Apache, IIS or Netlify.
Open toolCache-Control Header Generator
Create the right Cache-Control header with presets for static files, HTML pages and private data.
Open toolCanonical URL Generator
Normalise a URL and create the rel="canonical" tag that prevents duplicate content.
Open tool