docs: add reverse proxy guide for HTTP/2 support#3779
Conversation
- Add comprehensive reverse proxy configuration guide - Include examples for Nginx, Traefik, and Caddy - Update SendEarlyHints documentation with proxy reference - Provide production-ready configurations with security considerations Fixes #3735
|
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 |
|
Note Other AI code review bot(s) detectedCodeRabbit 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. WalkthroughUpdated SendEarlyHints docs to require HTTP/2+ and point to a new Reverse Proxy Configuration guide. Added a new guide documenting how to enable HTTP/2/HTTP/3 via common reverse proxies and how to configure Fiber behind a proxy. No public API changes. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Browser as Browser (HTTP/2+)
participant Proxy as Reverse Proxy (Nginx/Traefik/Caddy)
participant App as Fiber App (HTTP/1.1)
rect rgb(220,245,220)
Note over Browser,Proxy: Client⇄Proxy uses HTTP/2 or HTTP/3
Browser->>Proxy: Request (HTTP/2)
Proxy->>App: Forward request (may be HTTP/1.1)
end
rect rgb(245,235,220)
Note over App,Proxy: App may send 103 Early Hints
App->>Proxy: 103 Early Hints (HTTP/1.1)
Proxy->>Browser: Upgrade/translate to HTTP/2 103 if supported
end
rect rgb(235,240,255)
Note over Proxy,Browser: Browser receives Early Hints and starts preloads
Proxy->>Browser: 103 Early Hints (HTTP/2)
Browser->>Proxy: Requests for preloaded assets
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
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. Comment |
Summary of ChangesHello @sanki92, 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 introduces essential documentation to guide users on enabling HTTP/2 and HTTP/3 support for their Fiber applications through reverse proxy configurations. It addresses the previously undocumented requirement for features like Highlights
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
Pull Request Overview
This PR adds comprehensive reverse proxy documentation to help users enable HTTP/2 support for Fiber applications, specifically targeting features like SendEarlyHints that require modern protocols.
- Added a new reverse proxy configuration guide with examples for Nginx, Traefik, and Caddy
- Updated the
SendEarlyHintsdocumentation to reference the new proxy guide - Provided production-ready configuration examples and Fiber application setup instructions
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 support with configuration examples for major proxies |
| docs/api/ctx.md | Updated SendEarlyHints documentation to reference the new reverse proxy guide |
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
docs/api/ctx.md(1 hunks)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
docsfolder if necessary when modifying code
Files:
docs/api/ctx.mddocs/guide/reverse-proxy.md
There was a problem hiding this comment.
Code Review
This pull request adds a comprehensive and much-needed guide for configuring reverse proxies with Fiber to enable HTTP/2. The documentation is well-structured and covers popular proxies like Nginx, Traefik, and Caddy. I've provided some suggestions to improve the accuracy and security of the configuration examples, including updating Nginx's SSL settings, clarifying security implications, removing redundant configurations for Traefik and Caddy, and fixing a critical error in the Fiber application configuration example.
Remove duplicate mention of HTTP/2 requirement and improve clarity as suggested in code review.
- Fix Fiber v3 configuration with correct TrustProxy settings - Remove ssl_early_data directive for security - Update SSL cipher configuration with modern standards - Add security warning for Traefik dashboard exposure - Remove redundant proxy headers from Traefik and Caddy configs - Improve SendEarlyHints documentation clarity
Description
This PR adds comprehensive reverse proxy documentation to help users enable HTTP/2 support for Fiber applications. The
SendEarlyHintsfeature and other HTTP/2-dependent functionality require proper proxy configuration, which was previously undocumented.Fixes #3735
Changes introduced
SendEarlyHintssection indocs/api/ctx.mdto reference the new proxy guidedocs/guide/reverse-proxy.mdwith configuration examples for Nginx, Traefik, and CaddyType of change
Checklist
/docs/directory for Fiber's documentation.