Nginx Redirect Generator
Generate Nginx rewrite and return rules for URL redirects.
Type:
Old URLNew URL
→
$nginx config[DONE]
117 chars6 lines
Related Tools
FAQ
- What is the difference between return and rewrite in Nginx?
- return is simpler and faster — it sends the redirect response immediately without processing further rules. rewrite uses a regular expression to match and transform the URI, and can be combined with flags like permanent or redirect. Use return when possible for performance.
- Should I use 301 or 302 redirects?
- Use 301 (permanent) when a URL has moved for good — browsers and search engines cache this redirect and update their indexes. Use 302 (temporary) when the destination may change, such as during A/B testing or maintenance pages.
- Where do I place these rules in my Nginx config?
- Place rewrite and return directives inside a server {} or location {} block in your Nginx configuration file, typically in /etc/nginx/sites-available/your-site.conf. Run nginx -t to verify syntax before reloading.
Enter a list of old URL → new URL pairs and generate ready-to-paste Nginx redirect configuration. Choose between 301 permanent and 302 temporary redirects, and toggle regex rewrite mode for pattern-based rules. Output uses return or rewrite directives appropriate for Nginx server and location blocks.