caddy/modules/caddyhttp
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
..
caddyauth ci: use gci linter (#5708) 2023-08-14 09:41:15 -06:00
encode ci: use gci linter (#5708) 2023-08-14 09:41:15 -06:00
fileserver fileserver: browse template SVG icons and UI tweaks (#5812) 2023-09-15 19:05:45 -06:00
headers caddyhttp: Make use of http.ResponseController (#5654) 2023-08-02 20:03:26 +00:00
map
proxyprotocol ci: use gci linter (#5708) 2023-08-14 09:41:15 -06:00
push ci: use gci linter (#5708) 2023-08-14 09:41:15 -06:00
requestbody ci: use gci linter (#5708) 2023-08-14 09:41:15 -06:00
reverseproxy reverseproxy: Allow fallthrough for response handlers without routes (#5780) 2023-10-05 23:15:26 -04:00
rewrite ci: use gci linter (#5708) 2023-08-14 09:41:15 -06:00
standard
templates templates: Add dummy RemoteAddr to httpInclude request, proxy compatibility (#5845) 2023-10-07 20:47:34 +00:00
tracing ci: use gci linter (#5708) 2023-08-14 09:41:15 -06:00
app.go ci: use gci linter (#5708) 2023-08-14 09:41:15 -06:00
autohttps.go ci: use gci linter (#5708) 2023-08-14 09:41:15 -06:00
caddyhttp.go ci: Use gofumpt to format code (#5707) 2023-08-07 19:40:31 +00:00
caddyhttp_test.go
celmatcher.go ci: use gci linter (#5708) 2023-08-14 09:41:15 -06:00
celmatcher_test.go
duplex_go120.go ci: Update to Go 1.21 (#5719) 2023-08-09 12:34:28 -04:00
duplex_go121.go ci: Update to Go 1.21 (#5719) 2023-08-09 12:34:28 -04:00
errors.go caddyhttp: Preserve original error (fix #5652) 2023-07-25 09:41:56 -06:00
http2listener.go
httpredirectlistener.go caddyhttp: Use LimitedReader for HTTPRedirectListener 2023-09-26 07:32:46 -06:00
invoke.go caddyhttp: Implement named routes, invoke directive (#5107) 2023-05-16 15:27:52 +00:00
ip_matchers.go ci: use gci linter (#5708) 2023-08-14 09:41:15 -06:00
ip_range.go
logging.go ci: use gci linter (#5708) 2023-08-14 09:41:15 -06:00
marshalers.go
matchers.go ci: use gci linter (#5708) 2023-08-14 09:41:15 -06:00
matchers_test.go caddyhttp: Trim dot/space only on Windows (fix #5613) 2023-07-08 13:42:13 -06:00
metrics.go ci: use gci linter (#5708) 2023-08-14 09:41:15 -06:00
metrics_test.go
replacer.go ci: use gci linter (#5708) 2023-08-14 09:41:15 -06:00
replacer_test.go
responsematchers.go
responsematchers_test.go
responsewriter.go caddyhttp: Make use of http.ResponseController (#5654) 2023-08-02 20:03:26 +00:00
responsewriter_test.go
routes.go caddyhttp: Implement named routes, invoke directive (#5107) 2023-05-16 15:27:52 +00:00
server.go ci: use gci linter (#5708) 2023-08-14 09:41:15 -06:00
server_test.go logging: Add traceID field to access logs when tracing is active (#5507) 2023-04-27 02:46:41 +00:00
staticerror.go
staticresp.go ci: use gci linter (#5708) 2023-08-14 09:41:15 -06:00
staticresp_test.go
subroute.go
vars.go