Skip to content

Commit

Permalink
Revert "test: x-forwarded-proto"
Browse files Browse the repository at this point in the history
This reverts commit 31d9aa6.
  • Loading branch information
DIYgod committed Oct 22, 2023
1 parent 1c5a26f commit b238c43
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
8 changes: 6 additions & 2 deletions deploy/dev/cm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ data:
dns cloudflare {env.CF_API_TOKEN}
}
reverse_proxy xlog-internal.crossbell.svc:3000
reverse_proxy xlog-internal.crossbell.svc:3000 {
header_up x-forwarded-proto http
}
}
:8080 {
Expand All @@ -31,7 +33,9 @@ data:
on_demand
}
reverse_proxy xlog-internal.crossbell.svc:3000
reverse_proxy xlog-internal.crossbell.svc:3000 {
header_up x-forwarded-proto http
}
}
---
apiVersion: v1
Expand Down
5 changes: 0 additions & 5 deletions src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ export default async function middleware(req: NextRequest) {
requestHeaders.set("x-xlog-search", req.nextUrl.search)
requestHeaders.set("x-xlog-ip", getClientIp(req) || "")

console.log(
`x-forwarded-proto: ${req.headers.get(
"x-forwarded-proto",
)}, cf-visitor: ${req.headers.get("cf-visitor")}`,
)
if (
IS_PROD &&
req.headers.get("x-forwarded-proto") !== "https" &&
Expand Down

0 comments on commit b238c43

Please sign in to comment.