More screenshots

    Works with the AI tools you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseOpenClawOpenClaw+21 more

    Repair Redirect, Proxy & Routing Failures

    1

    Repair Redirect, Proxy & Routing Failures is a bounded ToolForge Labs workflow.

    $8.99

    Secure checkout via Stripe

    30-day refund guarantee

    Converts to your local currency at checkout

    Security scanned
    Repair Redirect, Proxy & Routing Failures

    Repair Redirect, Proxy & Routing Failures

    Example session with this skill installed

    Our Next.js app is behind an Nginx proxy. Requests to /dashboard are looping with 301s. It seems like the app thinks it is on HTTP while Nginx is handling SSL. Fix the middleware and Nginx config.

    • Read your context and instructions
    • Compiled the repair redirect proxy

    I have analyzed the Nginx configuration and the Next.js middleware. The redirect loop is caused by the application failing to recognize the X-Forwarded-Proto header, leading it to attempt a redirect to HTTPS which the proxy then terminates and passes back as HTTP.

    Proxy and Middleware Repair

    
    # Updated Nginx Location Block
    location / {
        proxy_pass http://nextjs_upstream;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
        
        # Ensure these headers are explicitly set for the application
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
    
    // middleware.ts or next.config.js Trust Logic
    // Ensure the application trusts the proxy headers to determine the protocol
    export function middleware(request) {
      const proto = request.headers.get('x-forwarded-proto');
      const host = request.headers.get('host');
      
      // Logic to prevent internal loops
      if (proto === 'http' && process.env.NODE_ENV === 'production') {
        return NextResponse.redirect(`https://${host}${request.nextUrl.pathname}`, 301);
      }
    }
    
    ComponentInvariantRepair Action
    NginxMust pass $scheme to X-Forwarded-ProtoAdded explicit header propagation in location block.
    Next.jsMust respect X-Forwarded-Proto for SSL detectionUpdated middleware to check headers before issuing 301.
    Trust BoundaryApplication must trust Nginx IP rangeVerified trust is restricted to the local VPC subnet.

    Next steps

    1. Apply the Nginx configuration changes and reload the service using nginx -s reload.
    2. Deploy the updated middleware to your staging environment.
    3. Verify the fix by running curl -I -H "X-Forwarded-Proto: http" https://yourdomain.com/dashboard to ensure only one redirect occurs.

    Connects securely to your tools. The creator never sees your data.

    What you get

    Resolve infinite 301/302 redirect loops in load-balanced environments.Repair broken X-Forwarded-Proto and X-Forwarded-Host header handling.Fix base-path and route-prefix stripping for apps on subdirectories.Secure trusted-proxy boundaries to prevent header spoofing.

    About this skill

    Repair Redirect, Proxy & Routing Failures is a bounded ToolForge Labs workflow. Repair reverse-proxy, redirect, forwarded-host/protocol/path, route-prefix, canonical URL, and proxy-trust failures. Works from repositories or partial configs/logs. Produces bounded repairs and deterministic tests while preserving authentication, trusted-proxy policy, tenant routing, path protections, and documented external URLs. It works from a full repository or partial evidence such as snippets, logs, configuration, traces, tickets, and architecture notes. The skill preserves existing product and security policy, separates verified facts from assumptions, avoids invented execution claims, and produces concrete repair or review steps with focused deterministic validation or traceable evidence.

    How to install

    Works the same in every agent - Claude, Cursor, Codex, Copilot and 20+ more.

    ~30 seconds
    1. 1

      Download the ZIP

      Free skills download straight away. Paid skills unlock right after purchase.

    2. 2

      Unzip into your skills folder

      Every agent reads skills from one folder on your machine. Drop the unzipped folder in there.

    3. 3

      Ask your agent to use it

      Restart the agent if it was already running. It picks the skill up automatically - no config needed.

    Skills folder by agent

    Click the path to copy it. Create the folder if it does not exist yet.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill passes our trust checks below.

    Security scanned

    Passed our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    30-day refund

    Not a fit? Get your money back

    Trust & safety

    Security scanned

    Verified clean 21 days ago

    • Passed all security checks, Safe to install

    Listed21 days ago

    What's inside

    Frequently Asked Questions