Detect if `trusted_proxies` and `client_ip_headers` are on, and do other header manupulation
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 25/100
Hướng nghiên cứu
The request concerns how FrankenPHP's Caddy integration handles trusted_proxies and client_ip_headers when setting $_SERVER values in the PHP SAPI, likely in the Go side where request environment variables are built. Start by locating where REMOTE_ADDR and HTTPS are populated for PHP requests and how Caddy's client IP settings reach it. Done means a design decision on a client_proto_headers-style option and tests showing X-Forwarded-Proto yields HTTPS only when trusted.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe your feature request
Is your feature request related to a problem? Please describe.
This previous discussion suggests that "FrankenPHP is not supposed to tell php the connection is https when it's not. Your application must handle the HTTP_X_FORWARDED_PROTO header, it's not the webservers job to lie to the application."
That is generally true -- when configuring following the Running being a reverse proxy instructions, FrankenPHP passes the request unmodified and application has to choose how to process it.
However, Caddy has trusted_proxies and client_ip_headers options which replace the REMOTE_ADDR value with the value provided by the proxy headers. This is convenient because the {client_ip} and other IP-based configuration can be used.
Using this option results in a situation where the application/framework's Trusted Proxies code doesn't see that the request came from a proxy -- which is exactly as desired, except that some other X-Forwarded-* values are not handled. Primarily, the X-Forwarded-Proto value is not translated to the HTTPS value in the $_SERVER superglobal, so the application/framework does not think the request came via a secure channel even though it did.
Describe the solution you'd like
It would be nice if we can detect that trusted_proxies and client_ip_headers are enabled and also process X-Forwarded-Proto. Alternatively, we may want this to be configurable and add another option - perhaps client_proto_headers - that can say which header(s) to look at, if present. (Unlike the base client_ip_headers, I do not think this can be added to Caddy itself, because the handling needs to be PHP-specific.)
Describe alternatives you've considered
There are two alternatives, which each have drawbacks:
- Tell the framework/application to "trust all proxies", so it will process the headers no matter what IP address is in
REMOTE_ADDR. This only works if traffic from non-proxy origins is completely blocked, which is not always practical. - Turn off
trusted_proxiesin Caddy/FrankenPHP, and only use the framework/application. This prevents Caddy's configuration from being able to use the real origin IP. Also, if multiple applications are used, they all need to be configured to handle proxy headers, instead of Caddy/FrankenPHP being able to do it all at once.
- Ngôn ngữ chính
- Go
- Star
- 11.5k
- Fork
- 506
- Merge trung bình
- 1 ngày 10 giờ
- Pull request đã merge (30 ngày)
- 64
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của php/frankenphp
-
enhancement
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
php/frankenphp#2806 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
php/frankenphp#2671 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Include frankenphp version in logsCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mởenhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
php/frankenphp#2483 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
suggestion about compile.mdCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mởenhancement
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 68/100
php/frankenphp#601 · 5 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
php/frankenphp#2771 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của php/frankenphp
Issue tương tự
-
Add an MCP server: imageatĐang mởneeds-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
stacklok/toolhive-catalog#1890 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
integrations/terraform-provider-github#3719 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Wayfinder sample agents don't reach the Data Plane on the quickstart packCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởType/Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
thunder-id/thunderid#6402 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
GoStratumEngineĐang mởaddition
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
awesome-selfhosted/awesome-selfhosted-data#3290 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
log4j2.xml from orchestration.extraConfiguration is rendered twice, and the install fails when orchestration.log4j2 is also setCó thể đã có người làm @irisfield đã nhận hôm nay. Đang mởplatform/local
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
camunda/camunda-platform-helm#7854 ·
Maintainer thường phản hồi trong vòng 1 ngày