fix(nginx): correct real_ip_header typo X-Forward-For β X-Forwarded-For#8935
Conversation
X-Forward-For is not a real HTTP header β the standard is X-Forwarded-For. With the typo, Nginx never replaces $remote_addr with the actual client IP, so rate limiting and IP logging see the proxy IP instead of the real client. Affects all three nginx configs (web, admin, space).
π WalkthroughWalkthroughThis pull request corrects a typo across three Nginx configuration files. The Changes
Estimated code review effortπ― 1 (Trivial) | β±οΈ ~2 minutes Poem
π₯ Pre-merge checks | β 5β Passed checks (5 passed)
βοΈ Tip: You can configure your own custom pre-merge checks in the settings. β¨ Finishing Touchesπ§ͺ Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
π€ Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@apps/space/nginx/nginx.conf`:
- Around line 12-15: The configuration currently uses set_real_ip_from 0.0.0.0/0
with real_ip_header X-Forwarded-For, which allows IP spoofing and defeats
limit_req_zone using $binary_remote_addr and $remote_addr; replace the wildcard
trust with the actual proxy/CDN/load-balancer CIDR ranges (or make
set_real_ip_from values configurable) so only trusted upstreams can set
X-Forwarded-For, and document the behavior if you must accept arbitrary sources;
update the same change in the other nginx.conf files that use set_real_ip_from,
real_ip_header, and limit_req_zone to ensure rate limits and logs remain
reliable.
πͺ Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
βΉοΈ Review info
βοΈ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 8782b2aa-8b26-4e35-80b3-049ca833e2ae
π Files selected for processing (3)
apps/admin/nginx/nginx.confapps/space/nginx/nginx.confapps/web/nginx/nginx.conf
|
@coderabbitai set_real_ip_from 0.0.0.0/0 is pre-existing and predates this PR β this PR only fixes the real_ip_header typo. The wildcard trust range is deployment-specific (correct CIDR depends on whether the user is behind Cloudflare, AWS ELB, custom proxy, etc.) and should be addressed separately as a configurable value per deployment. |
|
Only users with a collaborator, contributor, member, or owner role can interact with CodeRabbit. |
|
The change correctly fixes the Note (not blocking): the pre-existing |
Three small upstream infra fixes β no conflict with our setup. - nginx (web/admin/space): real_ip_header typo X-Forward-For β X-Forwarded-For. Without this, $remote_addr stays at the proxy IP so rate limiting and access logs see the proxy, not the actual client (makeplane#8935) - space Dockerfile: healthcheck targets /spaces/ instead of /, and add curl to the runtime image so the healthcheck can run (makeplane#8674) - aio supervisor.conf: correct space program directory and entry point β /app/space/apps/space + ./build/server/index.js (makeplane#8838) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
β¦or (makeplane#8935) X-Forward-For is not a real HTTP header β the standard is X-Forwarded-For. With the typo, Nginx never replaces $remote_addr with the actual client IP, so rate limiting and IP logging see the proxy IP instead of the real client. Affects all three nginx configs (web, admin, space).
Description
Fixes #8934
All three nginx configs had a typo in the
real_ip_headerdirective βX-Forward-Forinstead of the standardX-Forwarded-For.X-Forward-Foris not a real HTTP header, so Nginx silently ignored the directive and never replaced$remote_addrwith the actual client IP.Changes:
real_ip_header X-Forward-Forβreal_ip_header X-Forwarded-Forinapps/web/nginx/nginx.confreal_ip_header X-Forward-Forβreal_ip_header X-Forwarded-Forinapps/admin/nginx/nginx.confreal_ip_header X-Forward-Forβreal_ip_header X-Forwarded-Forinapps/space/nginx/nginx.confOne character added in 3 files, nothing else.
Type of Change
Test Scenarios
X-Forwarded-ForReferences
Closes #8934
Summary by CodeRabbit