summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/reverseproxy
AgeCommit message (Collapse)Author
2023-08-19httpcaddyfile: Stricter errors for site and upstream address schemes (#5757)Karun Agarwal
Co-authored-by: Mohammed Al Sahaf <msaa1990@gmail.com> Co-authored-by: Francis Lavoie <lavofr@gmail.com>
2023-08-17reverseproxy: Always return new upstreams (fix #5736) (#5752)Matt Holt
* reverseproxy: Always return new upstreams (fix #5736) * Fix healthcheck logger race
2023-08-14ci: use gci linter (#5708)Jacob Gadikian
* use gofmput to format code * use gci to format imports * reconfigure gci * linter autofixes * rearrange imports a little * export GOOS=windows golangci-lint run ./... --fix
2023-08-07ci: Use gofumpt to format code (#5707)Jacob Gadikian
2023-08-05reverseproxy: do not parse upstream address too early if it contains ↵Mohammed Al Sahaf
replaceble parts (#5695) * reverseproxy: do not parse upstream address too early if it contains replaceble parts * remove unused method * cleanup * accommodate partially replaceable port
2023-08-03reverseproxy: Fix hijack ordering which broke websockets (#5679)WeidiDeng
2023-08-02caddyhttp: Make use of `http.ResponseController` (#5654)Francis Lavoie
* caddyhttp: Make use of http.ResponseController Also syncs the reverseproxy implementation with stdlib's which now uses ResponseController as well https://github.com/golang/go/commit/2449bbb5e614954ce9e99c8a481ea2ee73d72d61 * Enable full-duplex for HTTP/1.1 * Appease linter * Add warning for builds with Go 1.20, so it's less surprising to users * Improved godoc for EnableFullDuplex, copied text from stdlib * Only wrap in encode if not already wrapped
2023-08-01reverseproxy: Connection termination cleanup (#5663)mmm444
2023-07-25reverseproxy: Export ipVersions type (#5648)Omar Ramadan
allows AUpstreams to be instantiated externally
2023-07-21go.mod: Update quic-go to v0.37.0, bump to Go 1.20 minimum (#5644)Marten Seemann
* update quic-go to v0.37.0 * Bump to Go 1.20 * Bump golangci-lint version, yml syntax consistency * Use skip-pkg-cache workaround * Workaround needed for both? * Seeding weakrand is no longer necessary --------- Co-authored-by: Matt Holt <mholt@users.noreply.github.com> Co-authored-by: Francis Lavoie <lavofr@gmail.com>
2023-07-11caddytls: Reuse certificate cache through reloads (#5623)Matt Holt
* caddytls: Don't purge cert cache on config reload * Update CertMagic This actually avoids reloading managed certs from storage when already in the cache, d'oh. * Fix bug; re-implement HasCertificateForSubject * Update go.mod: CertMagic tag
2023-07-08reverseproxy: Pointer receiverMatthew Holt
This avoids copying the Upstream, which has an atomically-accessed value in it.
2023-06-22reverseproxy: Honor `tls_except_port` for active health checks (#5591)Francis Lavoie
2023-06-20reverseproxy: weighted_round_robin load balancing policy (#5579)Saber Haj Rabiee
* added weighted round robin algorithm to load balancer * added an adapt integration test for wrr and fixed a typo * changed args format to Caddyfile args convention * added provisioner and validator for wrr * simplified the code and improved doc
2023-06-19reverseproxy: Experimental streaming timeouts (#5567)mmm444
* reverseproxy: WIP streaming timeouts * More verbose logging by using the child logger * reverseproxy: Implement streaming timeouts * reverseproxy: Refactor cleanup * reverseproxy: Avoid **time.Timer --------- Co-authored-by: Francis Lavoie <lavofr@gmail.com>
2023-06-12reverseproxy: Fix parsing of source IP in case it's an ipv6 address (#5569)Corin Langosch
2023-05-15reverseproxy: Expand port ranges to multiple upstreams in CLI + Caddyfile ↵Francis Lavoie
(#5494) * reverseproxy: Expand port ranges to multiple upstreams in CLI + Caddyfile * Add clarifying comment
2023-05-05reverseproxy: Optimize base case for least_conn and random_choose policies ↵Francis Lavoie
(#5487) When only a single request has the least amount of requests, there's no need to compute a random number, because the modulo of 1 will always be 0 anyways.
2023-05-05reverseproxy: Fix active health check header canonicalization, refactor (#5446)Francis Lavoie
2023-05-05reverseproxy: Add `fallback` for some policies, instead of always random (#5488)Francis Lavoie
2023-05-04fastcgi: Fix `capture_stderr` (#5515)eanavitarte
2023-05-03acmeserver: Configurable `resolvers`, fix smallstep deprecations (#5500)Francis Lavoie
* acmeserver: Configurable `resolvers`, fix smallstep deprecations * Improve default net/port * Update proxy resolvers parsing to use the new function * Update listeners.go Co-authored-by: itsxaos <33079230+itsxaos@users.noreply.github.com> --------- Co-authored-by: itsxaos <33079230+itsxaos@users.noreply.github.com>
2023-04-27logging: Add traceID field to access logs when tracing is active (#5507)Dave Henderson
Co-authored-by: Francis Lavoie <lavofr@gmail.com>
2023-04-25reverseproxy: Fix reinitialize upstream healthy metrics (#5498)Y.Horie
Co-authored-by: Dávid Szabó <david.szabo97@gmail.com>
2023-04-20caddyfile: Stricter parsing, error for brace on new line (#5505)Francis Lavoie
2023-04-10reverseproxy: Remove deprecated `lookup_srv` (#5396)Francis Lavoie
2023-04-04reverseproxy: Add `query` and `client_ip_hash` lb policies (#5468)Francis Lavoie
2023-03-31proxyprotocol: Add PROXY protocol support to `reverse_proxy`, add HTTP ↵Corin Langosch
listener wrapper (#5424) Co-authored-by: WeidiDeng <weidi_deng@icloud.com> Co-authored-by: Francis Lavoie <lavofr@gmail.com>
2023-03-31reverseproxy: Add mention of which half a copyBuffer err comes from (#5472)Francis Lavoie
Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
2023-03-27log: Make sink logs encodable (#5441)Mohammed Al Sahaf
* log: make `sink` encodable * deduplicate logger fields * extract common fields into `BaseLog` and embed it into `SinkLog` * amend godoc on `BaseLog` and `SinkLog` * minor style change --------- Co-authored-by: Francis Lavoie <lavofr@gmail.com>
2023-03-27caddytls: Eval replacer on automation policy subjects (#5459)Francis Lavoie
Also renamed the field to SubjectsRaw, which can be considered a breaking change but I don't expect this to affect much.
2023-03-27reverseproxy: Header up/down support for CLI command (#5460)Francis Lavoie
2023-03-16reverseproxy: Reset Content-Length to prevent FastCGI from hanging (#5435)Trea Hauet
Fixes: https://github.com/caddyserver/caddy/issues/5420
2023-02-27reverseproxy: allow specifying ip version for dynamic `a` upstream (#5401)Emily Lange
Co-authored-by: Francis Lavoie <lavofr@gmail.com>
2023-02-26caddyfile: Implement heredoc support (#5385)Francis Lavoie
2023-02-24cmd: Expand cobra support, add short flags (#5379)Francis Lavoie
* cmd: Expand cobra support * Convert commands to cobra, add short flags * Fix version command typo Co-authored-by: Emily Lange <git@indeednotjames.com> * Apply suggestions from code review Co-authored-by: Matt Holt <mholt@users.noreply.github.com> --------- Co-authored-by: Emily Lange <git@indeednotjames.com> Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
2023-02-24reverseproxy: refactor HTTP transport layer (#5369)Mohammed Al Sahaf
Co-authored-by: Francis Lavoie <lavofr@gmail.com> Co-authored-by: Weidi Deng <weidi_deng@icloud.com>
2023-02-16cmd: Adjust documentation for commands (#5377)Francis Lavoie
2023-02-11reverseproxy: Don't buffer chunked requests (fix #5366) (#5367)Matt Holt
* reverseproxy: Don't buffer chunked requests (fix #5366) Mostly reverts 845bc4d50b437995d574819850206e4b3db4040d (#5289) Adds warning for unsafe config. Deprecates unsafe properties in favor of simpler, safer designed ones. * Update modules/caddyhttp/reverseproxy/caddyfile.go Co-authored-by: Y.Horie <u5.horie@gmail.com> * Update modules/caddyhttp/reverseproxy/reverseproxy.go Co-authored-by: Y.Horie <u5.horie@gmail.com> * Update modules/caddyhttp/reverseproxy/reverseproxy.go Co-authored-by: Y.Horie <u5.horie@gmail.com> * Remove unused code --------- Co-authored-by: Y.Horie <u5.horie@gmail.com>
2023-02-08core: Support Windows absolute paths for UDS proxy upstreams (#5114)Steffen Brüheim
* added some tests for parseUpstreamDialAddress Test 4 fails because it produces "[[::1]]:80" instead of "[::1]:80" * support absolute windows path in unix reverse proxy address * make IsUnixNetwork public, support +h2c and reuse it * add new tests
2023-02-06reverseproxy: Log status code and byte count for websockets (#5140)WeidiDeng
* log response size for websocket request * record size when using hijack bufio.Writer
2023-01-25reverseproxy: Add flag to short command to disable redirects (#5330)Y.Horie
Co-authored-by: Francis Lavoie <lavofr@gmail.com> Fixes undefined
2023-01-10caddyhttp: Add server-level `trusted_proxies` config (#5103)Francis Lavoie
2023-01-09reverseproxy: Fix hanging for Transfer-Encoding: chunked (#5289)Y.Horie
* Fixes #5236 * enable request body buffering in reverse proxy when the request header has Transfer-Encoding: chunked
2023-01-06reverseproxy: Don't enable auto-https when `--from` flag is http (#5269)Emily Lange
2023-01-06reverseproxy: Set origreq in active health check (#5284)Matt Holt
* reverseproxy: Set origreq in active health check Fix #5281 * Oops; dereference Request
2022-12-05reverseproxy: Improve hostByHashing distribution (#5229)Alban Lecocq
* If upstreams are all using same host but with different ports ie: foobar:4001 foobar:4002 foobar:4003 ... Because fnv-1a has not a good enough avalanche effect Then the hostByHashing result is not well balanced over all upstreams As last byte FNV input tend to affect few bits, the idea is to change the concatenation order between the key and the upstream strings So the upstream last byte have more impact on hash diffusion
2022-11-30Clarify some docsMatthew Holt
2022-11-14reverseproxy: Mask the WS close message when we're the client (#5199)Francis Lavoie
* reverseproxy: Mask the WS close message when we're the client * weakrand * Bump golangci-lint version so path ignores work on Windows * gofmt * ugh, gofmt everything, I guess
2022-10-05caddytest: Revise sleep durationsMatthew Holt
Attempt to reduce flakiness a bit more Test suite needs to be rewritten.