caddy/modules
Thanmay Nath 5653c36bc2
templates: Add dummy RemoteAddr to httpInclude request, proxy compatibility (#5845)
* Enhancement: Allow X-Forwarded-For Header in httpInclude Virtual Requests

The goal of this enhancement is to modify the funcHTTPInclude function in the Caddy codebase to include the X-Forwarded-For header in the virtual request. This change will enable reverse proxies to set the X-Forwarded-For header, ensuring that the client's IP address is correctly provided to the target endpoint. This modification is essential for applications that depend on the X-Forwarded-For header for various functionalities, such as authentication, logging, or content customization.

* Updated tplcontext.go - set `virtReq.RemoteAddr = "127.0.0.1"`

i have made the suggested changes

* Apply suggestions from code review

* Update modules/caddyhttp/templates/tplcontext.go

---------

Co-authored-by: Francis Lavoie <lavofr@gmail.com>
2023-10-07 20:47:34 +00:00
..
caddyevents ci: use gci linter (#5708) 2023-08-14 09:41:15 -06:00
caddyhttp templates: Add dummy RemoteAddr to httpInclude request, proxy compatibility (#5845) 2023-10-07 20:47:34 +00:00
caddypki ci: use gci linter (#5708) 2023-08-14 09:41:15 -06:00
caddytls chore: Appease gosec linter (#5777) 2023-08-23 20:47:54 -06:00
filestorage ci: use gci linter (#5708) 2023-08-14 09:41:15 -06:00
logging logging: query filter for array of strings (#5779) 2023-08-29 22:59:43 +00:00
metrics ci: use gci linter (#5708) 2023-08-14 09:41:15 -06:00
standard events: Implement event system (#4912) 2022-08-31 15:01:30 -06:00