Nginx Redirect Generator

Generate Nginx redirect and rewrite rules. Create 301/302 redirects, HTTPS redirects, and www redirects.

39.0Kuses
9/10(135)

Redirect Rules

Nginx Config
server {
    listen 80;
    server_name example.com;
    return 301 https://$server_name$request_uri;
}

server {
    listen 443 ssl;
    server_name www.example.com;
    return 301 https://example.com$request_uri;
}

server {
    listen 443 ssl;
    server_name example.com;

    location = /old-page {
        return 301 /new-page;
    }

    # ... rest of your config
}

Features

  • 301 and 302 redirect rules
  • HTTP to HTTPS redirect
  • www to non-www redirect
  • Regex pattern support
⚡ Pro OptionsSponsored

Some links on this page are affiliate links. If you click and make a purchase, we may earn a commission at no extra cost to you.

Recommended Products

Ad

Affiliate Disclosure: As an Amazon Associate, ToolBird earns from qualifying purchases. Links above are affiliate links — if you buy through them, we may earn a small commission at no extra cost to you.

Disclaimer: This tool is provided as-is for informational and educational purposes only.

ToolBird Assistant

Find the right tool instantly

Hey! I'm ToolBird Assistant. Tell me what you need and I'll find the right tool for you.