- Home
- Skills
- APIs & Backend
- Repair Redirect, Proxy & Routing Failures
More screenshots
Works with the AI tools you already use
Repair Redirect, Proxy & Routing Failures
Repair Redirect, Proxy & Routing Failures is a bounded ToolForge Labs workflow.
$8.99
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);
}
}
| Component | Invariant | Repair Action |
|---|---|---|
| Nginx | Must pass $scheme to X-Forwarded-Proto | Added explicit header propagation in location block. |
| Next.js | Must respect X-Forwarded-Proto for SSL detection | Updated middleware to check headers before issuing 301. |
| Trust Boundary | Application must trust Nginx IP range | Verified trust is restricted to the local VPC subnet. |
Next steps
- Apply the Nginx configuration changes and reload the service using
nginx -s reload. - Deploy the updated middleware to your staging environment.
- Verify the fix by running
curl -I -H "X-Forwarded-Proto: http" https://yourdomain.com/dashboardto ensure only one redirect occurs.
Connects securely to your tools. The creator never sees your data.
What you get
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.
- 1
Download the ZIP
Free skills download straight away. Paid skills unlock right after purchase.
- 2
Unzip into your skills folder
Every agent reads skills from one folder on your machine. Drop the unzipped folder in there.
- 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