fix: middleware rewrite based on http req.url

This commit is contained in:
DIYgod 2023-08-22 00:13:35 +01:00
parent 7cf6df6fb1
commit f5d810a56d
No known key found for this signature in database
3 changed files with 5 additions and 5 deletions

View File

@ -19,7 +19,7 @@ data:
dns cloudflare {env.CF_API_TOKEN}
}
reverse_proxy http://xlog-internal.crossbell.svc:3000 {
reverse_proxy xlog-internal.crossbell.svc:3000 {
header_up X-Forwarded-Host {host}
}
}
@ -33,7 +33,7 @@ data:
on_demand
}
reverse_proxy http://xlog-internal.crossbell.svc:3000 {
reverse_proxy xlog-internal.crossbell.svc:3000 {
header_up X-Forwarded-Host {host}
}
}

View File

@ -19,7 +19,7 @@ data:
dns cloudflare {env.CF_API_TOKEN}
}
reverse_proxy http://xlog-internal.crossbell.svc:3000 {
reverse_proxy xlog-internal.crossbell.svc:3000 {
header_up X-Forwarded-Host {host}
}
}
@ -33,7 +33,7 @@ data:
on_demand
}
reverse_proxy http://xlog-internal.crossbell.svc:3000 {
reverse_proxy xlog-internal.crossbell.svc:3000 {
header_up X-Forwarded-Host {host}
}
}

View File

@ -94,7 +94,7 @@ export default async function middleware(req: NextRequest) {
return NextResponse.rewrite(
new URL(
`/site/${tenant?.subdomain}${pathname}${req.nextUrl.search}`,
req.url,
req.url.replace("https://", "http://"),
),
{
request: {