Skip to content

📒 docs: Document usage of reverse proxies for SendEarlyHints#3778

Merged
ReneWerner87 merged 31 commits intogofiber:mainfrom
akilesh1706:main
Oct 4, 2025
Merged

📒 docs: Document usage of reverse proxies for SendEarlyHints#3778
ReneWerner87 merged 31 commits intogofiber:mainfrom
akilesh1706:main

Conversation

@akilesh1706
Copy link
Contributor

@akilesh1706 akilesh1706 commented Oct 3, 2025

Description

This PR adds documentation to guide users on enabling HTTP/2 (and optionally HTTP/3) in Fiber applications using reverse proxies such as Nginx and Traefik.
The new page docs/guide/enabling-http2.md provides example configurations and references to official proxy documentation.
Additionally, the SendEarlyHints section in docs/api/ctx.md has been updated to link to this guide, helping users understand how to properly enable required protocols.

Fixes #3735

Changes introduced

List the new features or adjustments introduced in this pull request. Provide details on benchmarks, documentation updates, changelog entries, and if applicable, the migration guide.

  • Documentation Update:
    • Added new guide: docs/guide/enabling-http2.md
    • Updated docs/api/ctx.md
  • Examples: Included Nginx and Traefik config snippets for enabling HTTP/2.

Type of change

  • Documentation update (changes to documentation)

Checklist

Before you submit your pull request, please make sure you meet these requirements:

  • Followed the inspiration of the Express.js framework for new functionalities, making them similar in usage.
  • Conducted a self-review of the code and provided comments for complex or critical parts.
  • Updated the documentation in the /docs/ directory for Fiber's documentation.
  • No Unit tests required(documentation only).
  • Verified that any new dependencies are essential and have been agreed upon by the maintainers/community.
  • Aimed for optimal performance with minimal allocations in the new code.
  • Provided benchmarks for the new code to analyze and improve upon.

akilesh1706 and others added 15 commits October 2, 2025 15:01
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 3, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Updated documentation only: adjusted the SendEarlyHints caution in docs/api/ctx.md to mention explicit support and linked to a new reverse-proxy guide; added docs/guide/reverse-proxy.md with reverse-proxy configuration examples and notes for enabling HTTP/2 and experimental HTTP/3 (QUIC).

Changes

Cohort / File(s) Summary of Changes
Docs: SendEarlyHints note
docs/api/ctx.md
Clarified caution wording to "may not support sendEarlyHints" and added a link to the reverse-proxy guide; documentation-only.
Guide: Reverse proxy configurations
docs/guide/reverse-proxy.md
New guide describing reverse proxy usage (Nginx, Traefik, HAProxy, Caddy), TLS/HTTP/2 enabling, sample config snippets, HTTP/3 (QUIC) notes, and guidance for Early Hints; documentation-only.

Sequence Diagram(s)

(No sequence diagram — changes are documentation-only and do not modify control flow.)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Suggested reviewers

  • sixcolors
  • efectn

Poem

I hop through docs with tidy paws,
pointing to Nginx and Traefik laws.
Early Hints sing on HTTP/2 air,
QUIC peeks through, experimental and fair.
— a merry rabbit mapping proxy cares 🐇

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Title Check ✅ Passed The title succinctly identifies the new documentation on using reverse proxies for SendEarlyHints and aligns directly with the changes made without extraneous details.
Linked Issues Check ✅ Passed The changes fully address issue #3735 by adding a dedicated guide with Nginx and Traefik configuration examples, updating the SendEarlyHints documentation to link the guide, and providing official proxy documentation links as requested.
Out of Scope Changes Check ✅ Passed All modifications are focused on updating and adding documentation related to reverse proxy configuration for SendEarlyHints and no unrelated code or documentation outside the scope of the linked issue has been introduced.
Description Check ✅ Passed The pull request description follows the repository template by providing a clear summary, referencing the fixed issue, detailing documentation updates and examples, specifying the change type, and including a completed checklist, making it sufficiently complete for a documentation-only update.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c56194e and cbf2369.

📒 Files selected for processing (2)
  • docs/api/ctx.md (1 hunks)
  • docs/guide/reverse-proxy.md (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • docs/guide/reverse-proxy.md
  • docs/api/ctx.md

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.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @akilesh1706, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the Fiber documentation by introducing a dedicated guide on how to effectively use reverse proxies such as Nginx and Traefik to enable modern HTTP protocols like HTTP/2 and HTTP/3. This is crucial for ensuring that advanced Fiber features, specifically SendEarlyHints, function as intended in production environments, as they rely on these newer protocol versions. The update also integrates this new guide into existing documentation, making it easier for users to find relevant information.

Highlights

  • New Documentation for Reverse Proxies: A new guide, docs/guide/reverse-proxy.md, has been added to provide comprehensive instructions on configuring reverse proxies like Nginx and Traefik to enable HTTP/2 and HTTP/3 for Fiber applications.
  • Updated SendEarlyHints Documentation: The SendEarlyHints section in docs/api/ctx.md has been updated to include a direct link to the new reverse proxy guide, clarifying the requirements for HTTP/2 and newer protocols for this feature.
  • Configuration Examples: The new documentation includes practical configuration snippets for both Nginx and Traefik, demonstrating how to set up HTTP/2 and optionally HTTP/3 (QUIC) support.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds comprehensive documentation for configuring reverse proxies to enable HTTP/2 and HTTP/3 support in Fiber applications. The primary motivation is to help users properly configure features like SendEarlyHints that require modern HTTP protocols.

Key changes:

  • Added new reverse proxy guide with Nginx and Traefik configuration examples
  • Updated SendEarlyHints documentation to reference the new guide
  • Provided clear instructions for enabling HTTP/2 and optional HTTP/3 support

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
docs/guide/reverse-proxy.md New comprehensive guide covering reverse proxy setup for HTTP/2/3 with example configurations
docs/api/ctx.md Updated SendEarlyHints documentation to reference the new reverse proxy guide

@gaby
Copy link
Member

gaby commented Oct 3, 2025

@akilesh1706 Why did you open a new PR?

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds valuable documentation on using reverse proxies like Nginx and Traefik to enable HTTP/2 for Fiber applications, which is essential for features like SendEarlyHints. The changes are well-structured, with a new guide and an update to existing API documentation. My review includes suggestions to enhance the new guide by adding a crucial section on configuring Fiber to trust proxy headers, improving document structure, and making a link more specific for better navigation. Please also note that the PR description mentions the new file as docs/guide/enabling-http2.md, but the actual file added is docs/guide/reverse-proxy.md; this might be worth correcting for consistency.

@akilesh1706
Copy link
Contributor Author

@akilesh1706 Why did you open a new PR?

Previous PR looked messy. Had difficulty in tracking changes.

Added details about reverse proxies, including benefits and popular options.
@gaby gaby requested a review from Copilot October 4, 2025 04:40
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

akilesh1706 and others added 2 commits October 4, 2025 10:12
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Updated the title and ID for the reverse proxy guide to include an emoji.
Removed unnecessary colon from the Popular Reverse Proxies section.
@gaby gaby requested review from Copilot and grivera64 October 4, 2025 05:14
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Updated reverse proxy guide to improve clarity and fix formatting issues.
Clarify requirements for using early hints feature.
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between eb81b3d and c56194e.

📒 Files selected for processing (1)
  • docs/guide/reverse-proxy.md (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
docs/**

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Review and update the contents of the docs folder if necessary when modifying code

Files:

  • docs/guide/reverse-proxy.md

Updated links for HAProxy and Caddy in the guide.
Copy link
Member

@gaby gaby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 LGTM

Clarify the behavior of legacy HTTP/1.1 clients with Early Hints.
@gaby
Copy link
Member

gaby commented Oct 4, 2025

Pending @grivera64 approval

@ReneWerner87 ReneWerner87 enabled auto-merge (squash) October 4, 2025 13:46
@ReneWerner87 ReneWerner87 disabled auto-merge October 4, 2025 13:46
@ReneWerner87 ReneWerner87 merged commit a33bab1 into gofiber:main Oct 4, 2025
2 checks passed
@welcome
Copy link

welcome bot commented Oct 4, 2025

Congrats on merging your first pull request! 🎉 We here at Fiber are proud of you! If you need help or want to chat with us, join us on Discord https://gofiber.io/discord

@github-project-automation github-project-automation bot moved this from In Progress to Done in v3 Oct 4, 2025
@akilesh1706
Copy link
Contributor Author

@grivera64 @gaby
Good time contributing to this PR. Can I get any other issue assigned? I'll be more than happy to work on it.
Thanks.

Abhirup-99 pushed a commit to Abhirup-99/fiber that referenced this pull request Nov 3, 2025
…#3778)

* Documented reverse proxy workaround for SendEarlyHints

* Doc: Update docs/guide/enabling-http2.md

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* Doc: Update docs/guide/enabling-http2.md

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* Doc: Update docs/guide/enabling-http2.md

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* Doc: Update docs/guide/enabling-http2.md

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* 📒 docs: Document usage of reverse proxies for SendEarlyHints

* Delete docs/guide/enabling-http2.md

* Update docs/guide/reverse-proxy.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update docs/guide/reverse-proxy.md

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* Update docs/guide/reverse-proxy.md

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* Update docs/api/ctx.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update docs/guide/reverse-proxy.md

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* Change HTTP/3 support header to H3

* Update reverse-proxy.md

* Update docs/guide/reverse-proxy.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update docs/guide/reverse-proxy.md

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* Update docs/api/ctx.md

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* Revise reverse proxy guide for clarity and updates

Updated the title and section headers for clarity. Added details on configuring Fiber to trust proxy headers and updated the list of popular reverse proxies.

* Update docs/guide/reverse-proxy.md

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Update reverse proxy documentation for clarity

* Update docs/guide/reverse-proxy.md

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Enhance reverse proxy documentation with features and examples

Added details about reverse proxies, including benefits and popular options.

* Update docs/guide/reverse-proxy.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update docs/guide/reverse-proxy.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Revise reverse proxy guide title and ID

Updated the title and ID for the reverse proxy guide to include an emoji.

* Fix formatting in reverse-proxy.md

Removed unnecessary colon from the Popular Reverse Proxies section.

* Refine reverse proxy configuration documentation

Updated reverse proxy guide to improve clarity and fix formatting issues.

* Add caution about HTTP/2 requirement for early hints

Clarify requirements for using early hints feature.

* Fix links for HAProxy and Caddy in reverse proxy guide

Updated links for HAProxy and Caddy in the guide.

* Update caution note on sendEarlyHints feature

Clarify the behavior of legacy HTTP/1.1 clients with Early Hints.

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Juan Calderon-Perez <835733+gaby@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

🧹 [Maintenance]: Document reverse proxy workaround for SendEarlyHints

6 participants