summaryrefslogtreecommitdiff
path: root/modules/caddyhttp
AgeCommit message (Collapse)Author
2023-10-11fileserver: Set canonical URL on browse template (#5867)Forza
* Browse.html: Add canonical URL and home-link When contents are equal, but maybe just a sort order is different, it is good to add `<link rel="canonical" href="base-path/" />`. This helps search engines propeely index the page. I also added a link to the home page with the name of `{{.Host}}` just above the bread crumbs to make the page clearer. https://paste.tnonline.net/files/28Wun5CQZiqA_Screenshot_20231007_134435_Opera.png * Update browse.html
2023-10-11reverseproxy: Add more debug logs (#5793)Matt Holt
* reverseproxy: Add more debug logs This makes debug logging very noisy when reverse proxying, but I guess that's the point. This has shown to be useful in troubleshooting infrastructure issues. * Update modules/caddyhttp/reverseproxy/streaming.go Co-authored-by: Francis Lavoie <lavofr@gmail.com> * Update modules/caddyhttp/reverseproxy/streaming.go Co-authored-by: Francis Lavoie <lavofr@gmail.com> * Add opt-in `trace_logs` option * Rename to VerboseLogs --------- Co-authored-by: Francis Lavoie <lavofr@gmail.com>
2023-10-11reverseproxy: Fix `least_conn` policy regression (#5862)Francis Lavoie
2023-10-11reverseproxy: Add logging for dynamic A upstreams (#5857)Francis Lavoie
2023-10-11reverseproxy: Replace health header placeholders (#5861)Francis Lavoie
2023-10-11reverseproxy: fix parsing Caddyfile fails for unlimited request/response ↵Fred Cox
buffers (#5828)
2023-10-10reverseproxy: Fix retries on "upstreams unavailable" error (#5841)Francis Lavoie
2023-10-10encode: Add `application/wasm*` to the default content types (#5869)Christoph
2023-10-10fileserver: Add command shortcuts `-l` and `-a` (#5854)Kévin Dunglas
2023-10-07templates: Add dummy `RemoteAddr` to `httpInclude` request, proxy ↵Thanmay Nath
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-05reverseproxy: Allow fallthrough for response handlers without routes (#5780)Patrick Koenig
2023-09-26caddyhttp: Use LimitedReader for HTTPRedirectListenerMatthew Holt
2023-09-15fileserver: browse template SVG icons and UI tweaks (#5812)glowinthedark
* fileserver browse.html UI tweaks: folder-symlink icon, search fileserver browse.html UI tweaks: folder-symlink icon, search - ui - add folder-symlink SVG icon - search: use `<input type="search">` instead of `text` - fix npe with `sizebar.style.width` = null in grid mode * tabify whitespace Co-authored-by: Francis Lavoie <lavofr@gmail.com> --------- Co-authored-by: Francis Lavoie <lavofr@gmail.com>
2023-09-10reverseproxy: fix nil pointer dereference in AUpstreams.GetUpstreams (#5811)Pascal Vorwerk
fix a nil pointer dereference in AUpstreams.GetUpstreams when AUpstreams.Versions is not set (fixes caddyserver#5809) Signed-off-by: Pascal Vorwerk <info@fossores.de>
2023-08-29fileserver: Export BrowseTemplateMatthew Holt
This allows programs embedding Caddy to customize the browse template.
2023-08-23chore: Appease gosec linter (#5777)Matt Holt
These happen to be harmless memory aliasing but I guess the linter can't know that and we can't really prove it in general.
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-18fileserver: docs: clarify the ability to produce JSON array with `browse` ↵Mohammed Al Sahaf
(#5751)
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-11fileserver: Slightly more fitting iconsMatthew Holt
2023-08-09fileserver: Don't repeat error for invalid method inside error context (#5705)Francis Lavoie
2023-08-09ci: Update to Go 1.21 (#5719)Matt Holt
* ci: Update to Go 1.21 * Bump quic-go to v0.37.4 * Check EnableFullDuplex err * Linter bug suppression See https://github.com/timakin/bodyclose/issues/52 --------- Co-authored-by: Francis Lavoie <lavofr@gmail.com>
2023-08-07ci: Use gofumpt to format code (#5707)Jacob Gadikian
2023-08-07templates: Fix httpInclude (fix #5698)Matthew Holt
Allowable during feature freeze because this is a simple, non-invasive bug fix only.
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-03fileserver: browse: Render SVG images in gridMatthew Holt
2023-08-03reverseproxy: Fix hijack ordering which broke websockets (#5679)WeidiDeng
2023-08-02encode: Fix infinite recursion (#5672)Francis Lavoie
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-25caddyhttp: Preserve original error (fix #5652)Matthew Holt
2023-07-22fileserver: add lazy image loading (#5646)ydylla
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-17fileserver: Tweak grid view of browse templateMatthew Holt
All cells on row have same height. Center-align vertically.
2023-07-13fileserver: add `export-template` sub-command to `file-server` (#5630)Mohammed Al Sahaf
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-07-08caddyhttp: Trim dot/space only on Windows (fix #5613)Matthew Holt
Follow-up to #2917. Path matcher needs to trim dots and spaces but only on Windows.
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-16chore: remove refs of deprecated io/ioutil (#5576)guangwu
2023-06-15headers: Allow `>` to defer shortcut for replacements (#5574)Francis Lavoie
2023-06-13caddyhttp: Support custom network for HTTP/3 (#5573)Dominik Roos
Allow registering a custom network mapping for HTTP/3. This is useful if the original network for HTTP/1.1 and HTTP/2 is not a standard `unix`, `tcp4`, or `tcp6` network. To keep backwards compatibility, we fall back to `udp` if the original network is not registered in the mapping. Fixes #5555
2023-06-12reverseproxy: Fix parsing of source IP in case it's an ipv6 address (#5569)Corin Langosch
2023-06-05fileserver: browse: Better grid layout (#5564)365cent
* feat: better implementation of grid layout * fix: vertical alignment
2023-05-26templates: Add `readFile` action that does not evaluate templates (#5553)kassienull
* Create an includeRaw template function to include a file without parsing it as a template. Some formatting fixes * Rename to readFile, various docs adjustments --------- Co-authored-by: Francis Lavoie <lavofr@gmail.com>
2023-05-22fileserver: Don't set Etag if mtime is 0 or 1 (close #5548) (#5550)Matt Holt