Skip to content

fix(web): Set metadataBase to fix og:image URL behind reverse proxy - #908

Merged
brendan-kellam merged 2 commits into
mainfrom
brendan/fix-opengraph-image-url-behind-proxy
Feb 19, 2026
Merged

brendan-kellam merged 2 commits into
mainfrom
brendan/fix-opengraph-image-url-behind-proxy

Conversation

@brendan-kellam

@brendan-kellam brendan-kellam commented Feb 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Without metadataBase, Next.js falls back to the raw HTTP request host header when constructing the absolute og:image URL from opengraph-image.tsx
  • Behind the reverse proxy, the internal host (localhost:8080) was being used, producing an invalid public OG image URL
  • Setting metadataBase: new URL(env.AUTH_URL) in the root layout tells Next.js to use the public-facing URL for all auto-generated metadata URLs

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Fixed og:image metadata URLs incorrectly resolving to localhost when the application is deployed behind a reverse proxy.
brendan-kellam and others added 2 commits February 18, 2026 21:11
Without metadataBase, Next.js falls back to the raw HTTP request host
(localhost:8080) when constructing the absolute og:image URL from
opengraph-image.tsx. Setting metadataBase to AUTH_URL ensures the
public-facing URL is used instead.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions

This comment has been minimized.

@coderabbitai

coderabbitai Bot commented Feb 19, 2026 •

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

Walkthrough

Adds metadataBase: new URL(env.AUTH_URL) to Next.js metadata in packages/web/src/app/layout.tsx and updates CHANGELOG.md with an Unreleased "Fixed" entry describing an og:image URL resolving to localhost behind reverse proxies.

Changes

Cohort / File(s) Summary
Metadata Configuration
packages/web/src/app/layout.tsx
Added metadataBase: new URL(env.AUTH_URL) to the exported metadata object.
Changelog
CHANGELOG.md
Added Unreleased "Fixed" entry documenting fix for og:image URL resolving to localhost when deployed behind a reverse proxy.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

✨ Finishing Touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch brendan/fix-opengraph-image-url-behind-proxy

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@brendan-kellam
brendan-kellam merged commit 048a701 into main Feb 19, 2026
8 of 9 checks passed
@brendan-kellam
brendan-kellam deleted the brendan/fix-opengraph-image-url-behind-proxy branch February 19, 2026 05:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant