Nginx Redirect Generator
Create Nginx redirect rules from a list of old and new URLs, plus HTTPS and www server blocks. Copy clean configuration that is ready to add to your site's server block.
How to add Nginx redirects
- List each redirect as old path | new URL.
- Add server blocks if you also need HTTPS and www redirects.
- Paste the page rules inside your site’s main server block.
- Test with nginx -t, then reload Nginx and check each old URL.
Nginx redirect methods
| Method | Use for |
|---|---|
| location = /path { return 301 ... } | One exact page |
| location ^~ /folder/ { return 301 ... } | Everything in a folder |
| server { return 301 https://...$request_uri; } | Whole domain, HTTPS or www changes |
| rewrite ^/old/(.*)$ /new/$1 permanent; | Pattern-based moves that keep part of the path |
Shared hosting?
Most shared hosts in India run Apache or LiteSpeed, where you edit .htaccess instead. Use the htaccess redirect generator for those. If your host gives you no server access, use your SEO plugin’s redirect manager.
Related tools
Find chains in your redirect list with the redirect chain checker, look up codes in the HTTP status codes list, and plan moves with the site migration checklist.
More free tools and guides
Practise tools like this on real projects in our digital marketing course in Faridabad, with weekday, weekend and online batches.
See the courseAll free toolsAsk on WhatsAppFrequently Asked Questions
Is this Nginx redirect generator free?
Yes. It is free with no sign-up and works in your browser.
Should I use return or rewrite in Nginx?
Use return for simple redirects. It is clearer and faster. Use rewrite only when you need patterns.
Where is the Nginx config file?
Often in /etc/nginx/sites-available/ or /etc/nginx/conf.d/, depending on your server setup.
Does a 301 in Nginx pass SEO value?
Yes. A 301 redirect signals a permanent move, and search engines transfer signals to the new URL.