Skip to content

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

Closed
akilesh1706 wants to merge 15 commits into
gofiber:mainfrom
akilesh1706:main
Closed

📒 docs: Document usage of reverse proxies for SendEarlyHints#3776
akilesh1706 wants to merge 15 commits into
gofiber:mainfrom
akilesh1706:main

Conversation

@akilesh1706
Copy link
Copy Markdown
Contributor

@akilesh1706 akilesh1706 commented Oct 2, 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 # (issue)

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 akilesh1706 requested a review from a team as a code owner October 2, 2025 09:41
@akilesh1706 akilesh1706 requested review from ReneWerner87, Copilot, efectn, gaby and sixcolors and removed request for Copilot October 2, 2025 09:41
@welcome
Copy link
Copy Markdown

welcome Bot commented Oct 2, 2025

Thanks for opening this pull request! 🎉 Please check out our contributing guidelines. If you need help or want to chat with us, join us on Discord https://gofiber.io/discord

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Oct 2, 2025

Caution

Review failed

The pull request is closed.

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

Updates documentation: replaces the SendEarlyHints HTTP/2 caution in docs/api/ctx.md with a link to new reverse-proxy guidance, and adds docs/guide/reverse-proxy.md describing Nginx/Traefik configurations for enabling HTTP/2 (and optional HTTP/3), TLS termination, Early Hints, and references.

Changes

Cohort / File(s) Summary
Docs — API caution update
docs/api/ctx.md
Replaces the SendEarlyHints HTTP/2 requirement note with a link to the new reverse-proxy guidance; editorial text change only.
Docs — Reverse proxy guide (new)
docs/guide/reverse-proxy.md
New guide adding Nginx and Traefik examples for enabling HTTP/2 and experimental HTTP/3 (QUIC), notes on TLS termination and Early Hints, and reference links.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues

Possibly related PRs

Suggested reviewers

  • gaby
  • sixcolors
  • ReneWerner87
  • efectn

"hop hop—proxy lanes align,
Nginx hums, Traefik signs,
h2 streams, h3 peeks through,
Early Hints nudge what to do.
I nibble docs, neat and terse—🥕"

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The description follows the required template structure with a clear summary, change list, type, and checklist, but the “Fixes # (issue)” placeholder is left empty and should be either populated with the relevant issue number or removed to fully comply with the template. Please provide a valid issue number after “Fixes #” or remove the placeholder line if no issue is being closed, ensuring all template fields are accurately filled.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title succinctly reflects the primary change by indicating that documentation for using reverse proxies with SendEarlyHints is being added, and it directly aligns with the main updates described in the PR.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

📜 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 75f3528 and 1239df4.

📒 Files selected for processing (1)
  • docs/guide/reverse-proxy.md (1 hunks)

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
Copy Markdown
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 significantly enhances the Fiber documentation by providing clear guidance on how to enable HTTP/2 and HTTP/3 in Fiber applications, particularly when using reverse proxies such as Nginx and Traefik. The changes introduce a dedicated guide with practical configuration examples and integrate a reference to this guide within the "SendEarlyHints" documentation, ensuring users have the necessary information to leverage modern HTTP features effectively.

Highlights

  • New HTTP/2/3 Enabling Guide: A new documentation page, "docs/guide/enabling-http2.md", has been added to provide comprehensive instructions on enabling HTTP/2 and optionally HTTP/3 for Fiber applications using reverse proxies like Nginx and Traefik.
  • SendEarlyHints Documentation Update: The "SendEarlyHints" section in "docs/api/ctx.md" has been updated to include a direct link to the new HTTP/2 enabling guide, ensuring users can easily find information on required protocol configurations.
  • Reverse Proxy Configuration Examples: The new guide includes practical configuration examples for both Nginx and Traefik, making it easier for users to set up their reverse proxies to support HTTP/2 and HTTP/3.
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
Copy Markdown
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 for enabling HTTP/2 with reverse proxies. The new guide is clear and provides useful examples for Nginx and Traefik. I've provided a few suggestions to improve the examples and formatting for better clarity and correctness. The most important suggestion is to add standard proxy headers to the Nginx configuration to ensure the backend application receives necessary client information.

Comment on lines +31 to +32
proxy_set_header Host $host;
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

This Nginx configuration is missing important headers for a reverse proxy setup. To ensure the backend Fiber application can correctly identify the client's IP address and the protocol used, you should add X-Real-IP, X-Forwarded-For, and X-Forwarded-Proto headers. This is crucial for logging, security, and generating correct URLs.

Suggested change
proxy_set_header Host $host;
}
proxy_set_header Host $host;
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;
}

Comment thread docs/guide/enabling-http2.md Outdated
Comment thread docs/guide/enabling-http2.md Outdated
Comment thread docs/guide/enabling-http2.md Outdated
Comment thread docs/guide/enabling-http2.md Outdated
Comment thread docs/guide/enabling-http2.md Outdated
Copy link
Copy Markdown
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: 0

🧹 Nitpick comments (2)
docs/guide/enabling-http2.md (1)

18-57: Use the matching code fence language for each proxy example.

Label the Nginx block as nginx (or conf) and the Traefik block as yaml so readers get accurate syntax highlighting instead of the current go highlighting.

docs/api/ctx.md (1)

2176-2180: Complete the caution sentence about legacy clients.

While you’re touching this block, please finish the sentence so it reads cleanly—for example: “Some legacy HTTP/1.1 clients may not support Early Hints.” Keep the new guide link right after it.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a3c54bb and 19e1b44.

📒 Files selected for processing (2)
  • docs/api/ctx.md (1 hunks)
  • docs/guide/enabling-http2.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/api/ctx.md
  • docs/guide/enabling-http2.md

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Copilot AI review requested due to automatic review settings October 2, 2025 09:48
akilesh1706 and others added 2 commits October 2, 2025 15:18
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>
Copy link
Copy Markdown
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 documentation to help users enable HTTP/2 (and optionally HTTP/3) in Fiber applications using reverse proxies, specifically addressing the requirements for features like SendEarlyHints that need HTTP/2 or newer protocols.

  • Created a comprehensive guide for configuring reverse proxies to enable HTTP/2
  • Added cross-reference from SendEarlyHints documentation to the new guide
  • Provided example configurations for Nginx and Traefik

Reviewed Changes

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

File Description
docs/guide/enabling-http2.md New guide with reverse proxy configurations for enabling HTTP/2 support
docs/api/ctx.md Added reference link to the HTTP/2 enabling guide from SendEarlyHints section

Comment thread docs/guide/enabling-http2.md Outdated
Comment thread docs/guide/enabling-http2.md Outdated
Comment thread docs/api/ctx.md Outdated
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@gaby gaby changed the title Doc: Documented reverse proxy workaround for SendEarlyHints 📒 docs: Document usage of reverse proxies for SendEarlyHints Oct 2, 2025
@gaby
Copy link
Copy Markdown
Member

gaby commented Oct 2, 2025

@akilesh1706 Check the ci failures and suggested changes

@gaby gaby added this to v3 Oct 2, 2025
@gaby gaby added this to the v3 milestone Oct 2, 2025
Comment thread docs/guide/enabling-http2.md Outdated
Comment thread docs/guide/enabling-http2.md Outdated
@gaby
Copy link
Copy Markdown
Member

gaby commented Oct 3, 2025

/gemini review

@gaby gaby requested review from Copilot and grivera64 October 3, 2025 11:01
Copy link
Copy Markdown
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 3 comments.

Comment thread docs/api/ctx.md Outdated
Comment thread docs/guide/reverse-proxy.md Outdated
Comment thread docs/guide/reverse-proxy.md Outdated
Copy link
Copy Markdown
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 with Fiber to enable HTTP/2 and HTTP/3. My review includes a few suggestions to enhance the new documentation page. The most critical feedback is to include X-Forwarded-* headers in the Nginx configuration example, as this is essential for applications behind a proxy to function correctly. I've also suggested minor improvements to the page's metadata, headings, and external links for better clarity and consistency.

Comment thread docs/guide/reverse-proxy.md
Comment thread docs/guide/reverse-proxy.md Outdated
Comment thread docs/guide/reverse-proxy.md Outdated
akilesh1706 and others added 7 commits October 3, 2025 16:33
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>
@akilesh1706 akilesh1706 closed this Oct 3, 2025
@github-project-automation github-project-automation Bot moved this to Done in v3 Oct 3, 2025
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.

4 participants