Skip to content

Comments

docs: update proxy examples to remove unnecessary path segments#7140

Merged
chenjiahan merged 6 commits intomainfrom
proxy_example_0204
Feb 4, 2026
Merged

docs: update proxy examples to remove unnecessary path segments#7140
chenjiahan merged 6 commits intomainfrom
proxy_example_0204

Conversation

@chenjiahan
Copy link
Member

Summary

Update proxy examples to remove unnecessary path segments. Because I misunderstood the section on “Removed req.url patching” in https://github.com/chimurai/http-proxy-middleware/blob/master/MIGRATION.md#removed-requrl-patching, I ended up writing an incorrect example.

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings February 4, 2026 07:11
@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @chenjiahan, 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 addresses an inaccuracy in the proxy configuration examples and documentation, which stemmed from a misunderstanding of http-proxy-middleware v3's behavior. It updates the examples to correctly configure proxy targets without redundant path segments, ensuring that users follow the intended and functional setup for proxying.

Highlights

  • Corrected Proxy Examples: Updated all proxy configuration examples in the documentation and an E2E test to remove unnecessary path segments from target URLs.
  • Clarified http-proxy-middleware v3 Behavior: The changes reflect the correct understanding that http-proxy-middleware v3 does not require the proxied path to be explicitly included in the target URL, contrary to previous documentation.
  • Documentation Refinement: Removed misleading sections from the proxy.mdx and upgrade guides that incorrectly described http-proxy-middleware v3's req.url patching behavior.
Changelog
  • e2e/cases/server/proxy-mixed-rules/index.test.ts
    • Updated proxy target URLs for /foo and /bar to remove redundant path segments, aligning with correct http-proxy-middleware v3 behavior.
  • website/docs/en/config/server/proxy.mdx
    • Corrected proxy examples by removing path segments from target URLs (e.g., /api now targets http://localhost:3001 instead of http://localhost:3001/api).
    • Removed the "Version differences" section that contained an incorrect explanation of http-proxy-middleware v3's req.url patching.
  • website/docs/en/guide/upgrade/v1-to-v2.mdx
    • Removed the incorrect explanation about http-proxy-middleware v3 requiring explicit path inclusion in target from the "Proxy middleware upgraded" section.
    • Reorganized the "Proxy middleware upgraded" section to only include correct migration details for context to pathFilter and event handling.
  • website/docs/zh/config/server/proxy.mdx
    • Corrected proxy examples by removing path segments from target URLs, similar to the English documentation.
    • Removed the "版本差异" (Version differences) section that contained an incorrect explanation.
  • website/docs/zh/guide/upgrade/v1-to-v2.mdx
    • Removed the incorrect explanation about http-proxy-middleware v3 requiring explicit path inclusion in target from the "Proxy 中间件升级" section.
    • Reorganized the "Proxy 中间件升级" section to only include correct migration details.
Activity
  • The pull request was opened by chenjiahan.
  • The author provided a summary of the changes and noted that the previous examples were incorrect due to a misunderstanding of http-proxy-middleware v3's "Removed req.url patching" behavior.
  • The checklist for tests and documentation updates remains unchecked, indicating that no additional tests or documentation beyond the changes in this PR were explicitly performed or are required.
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.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Feb 4, 2026

Deploying rsbuild with  Cloudflare Pages  Cloudflare Pages

Latest commit: c19a387
Status: ✅  Deploy successful!
Preview URL: https://15d1d24b.rsbuild-v2.pages.dev
Branch Preview URL: https://proxy-example-0204.rsbuild-v2.pages.dev

View logs

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 correctly updates the proxy examples across the documentation (both English and Chinese) and e2e tests to align with the behavior of http-proxy-middleware v3. The removal of unnecessary path segments from the target URLs is a good fix that resolves the misunderstanding mentioned in the description. I've added one suggestion to improve consistency in the test file's proxy configuration.

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

Updates Rsbuild documentation and tests to correct proxy configuration examples by removing unnecessary path segments in target URLs (aligning with http-proxy-middleware v3 behavior).

Changes:

  • Fix proxy target examples to avoid duplicating path segments (e.g., /api/api/..., /foo/foo/...).
  • Adjust upgrade guides (EN/ZH) to remove the incorrect migration note about needing to include the proxied path in target.
  • Update an e2e proxy test to reflect the corrected proxy target behavior.

Reviewed changes

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

Show a summary per file
File Description
website/docs/zh/guide/upgrade/v1-to-v2.mdx Removes the incorrect target-path guidance and keeps the remaining v2→v3 proxy option migration notes.
website/docs/zh/config/server/proxy.mdx Fixes proxy examples by removing unnecessary path segments from target URLs.
website/docs/en/guide/upgrade/v1-to-v2.mdx Mirrors the ZH upgrade guide adjustments for proxy middleware migration notes.
website/docs/en/config/server/proxy.mdx Updates some proxy examples (local/ws/bypass), but still has an inconsistent “Basic usage” example needing correction.
e2e/cases/server/proxy-mixed-rules/index.test.ts Updates proxy test targets to avoid path duplication when forwarding.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings February 4, 2026 07:20
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 5 out of 5 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@chenjiahan chenjiahan merged commit 1258fa9 into main Feb 4, 2026
6 checks passed
@chenjiahan chenjiahan deleted the proxy_example_0204 branch February 4, 2026 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant