Matthew Holt
b07f6958ac
Use "IsUnixNetwork" function instead of repeating the logic
5 years ago
lu4p
68adfdc559
Fix misspellings ( #2908 )
5 years ago
Matthew Holt
db4293cb5f
reverse_proxy: Add flush_interval to caddyfile syntax ( #1460 )
Also add godoc for Caddyfile syntax for file_server
5 years ago
Matthew Holt
8de1a76227
reverse_proxy: Fix invalid argument to Intn in RandomChoice selection
5 years ago
Matthew Holt
1228dd7d93
reverse_proxy: Allow buffering of client requests
This is a bad idea, but some backends apparently require it. See
discussion in #176 .
5 years ago
Matthew Holt
8025ad9107
cmd: Disable admin endpoint for file-server and reverse-proxy commands
This makes it easier to use multiple instances on the same machine
5 years ago
Mohammed Al Sahaf
93bc1b72e3
core: Use port ranges to avoid OOM with bad inputs ( #2859 )
* fix OOM issue caught by fuzzing
* use ParsedAddress as the struct name for the result of ParseNetworkAddress
* simplify code using the ParsedAddress type
* minor cleanups
5 years ago
Matthew Holt
95615f5377
reverse_proxy: Fix NTLM auth detection
D'oh. Got mixed up in a refactoring.
5 years ago
Matthew Holt
8e515289cb
reverse_proxy: Add support for NTLM
5 years ago
Matthew Holt
97d918df3e
reverse_proxy: Make HTTP versions configurable, don't set NextProtos
5 years ago
Matthew Holt
bf363f061d
reverse_proxy: Add UnmarshalCaddyfile for random_choose selection policy
Also allow caddy.Duration to be given integer values which are treated
like regular time.Duration values (nanoseconds).
Fixes #2856
5 years ago
Matthew Holt
cb25dd72ab
reverse_proxy: Add port to upstream address if only implied in scheme
5 years ago
Matthew Holt
8ef0a0b4f8
reverse_proxy: Fix panic for some CLI flag values ( closes #2848 )
5 years ago
Matthew Holt
dccba71276
reverse_proxy: Structured logs
5 years ago
Matthew Holt
54e458b756
proxy: Forgot to commit import
5 years ago
Matthew Holt
813fff0584
proxy: Enable HTTP/2 on transport to backend
5 years ago
Matthew Holt
442fd748f6
caddyhttp: Minor cleanup and fix nil pointer deref in caddyfile adapter
5 years ago
Matt Holt
b00dfd3965
v2: Logging! ( #2831 )
* logging: Initial implementation
* logging: More encoder formats, better defaults
* logging: Fix repetition bug with FilterEncoder; add more presets
* logging: DiscardWriter; delete or no-op logs that discard their output
* logging: Add http.handlers.log module; enhance Replacer methods
The Replacer interface has new methods to customize how to handle empty
or unrecognized placeholders. Closes #2815 .
* logging: Overhaul HTTP logging, fix bugs, improve filtering, etc.
* logging: General cleanup, begin transitioning to using new loggers
* Fixes after merge conflict
5 years ago
yzongyue
fcd8869f51
reverse_proxy: optimize MaxIdleConnsPerHost default ( #2809 )
5 years ago
Matthew Holt
1e31be8de0
reverse_proxy: Allow dynamic backends ( closes #990 and #1539 )
This PR enables the use of placeholders in an upstream's Dial address.
A Dial address must represent precisely one socket after replacements.
See also #998 and #1639 .
5 years ago
Matthew Holt
8715a28320
reverse_proxy: Customize SNI value in upstream request ( closes #2483 )
5 years ago
Matthew Holt
9c0bf311f9
Miscellaneous cleanups / comments
5 years ago
Matthew Holt
bcbe1c220d
reverse_proxy: Add local circuit breaker
This migrates a feature that was previously reserved for enterprise
users, according to https://github.com/caddyserver/caddy/issues/2786 .
The local circuit breaker is a simple metrics counter that can cause
the reverse proxy to consider a backend unhealthy before it actually
goes offline, by measuring recent latencies over a sliding window.
Credit to Danny Navarro
5 years ago
Matthew Holt
be7abda7d4
reverse_proxy: Implement retry_match; by default only retry GET requests
See https://caddy.community/t/http-proxy-and-non-get-retries/6304
5 years ago
Matthew Holt
44cb804b9e
reverse_proxy: Configurable request headers on active health checks
See https://caddy.community/t/health-check-user-agent/6309
5 years ago
Matthew Holt
c11e3bffd6
Add file-server and reverse-proxy subcommands
5 years ago
Matthew Holt
2f684e42d5
reverse_proxy/headers: Expose header replacement ability in Caddyfile
Adds header_up and header_down subdirectives to reverse_proxy
5 years ago
Matt Holt
484cee1ac1
fastcgi: Implement / redirect for index.php with php_fastcgi directive ( #2754 )
* fastcgi: Implement / redirect for index.php with php_fastcgi directive
See #2752 and https://caddy.community/t/v2-redirect-path-to-path-index-php-with-assets/6196?u=matt
* caddyhttp: MatchNegate implements json.Marshaler
* fastcgi: Add /index.php element to try_files matcher
* fastcgi: Make /index.php redirect permanent
5 years ago
Matthew Holt
db4c73dd58
reverse_proxy: Close idle connections on module unload
5 years ago
Matthew Holt
f15f0d5839
Eliminate some TODOs
5 years ago
Matthew Holt
e73b117332
reverse_proxy: Ability to mutate headers; set upstream placeholders
5 years ago
Matthew Holt
758269124e
reverseproxy: Fix host and port on requests; fix Caddyfile parser
5 years ago
Matthew Holt
194df652eb
reverseproxy: Add 'tls' option to enable HTTPS with HTTP transport
5 years ago
Matthew Holt
2459c292a4
caddyfile: Improve Dispenser.NextBlock() to support nesting
5 years ago
Matthew Holt
0cf592fa2e
New 'php_fastcgi' directive for convenient PHP+FastCGI reverse proxy
5 years ago
Matthew Holt
c32b7e8865
fastcgi: Make EnvVars a map instead of a slice
5 years ago
Matthew Holt
b4f4fcd437
Migrate some selection policy tests over to v2
5 years ago
Matthew Holt
50e62d06bc
reverse_proxy: Caddyfile integration (and fix blocks in Dispenser)
5 years ago
Matthew Holt
14f9662f9c
Various fixes/tweaks to HTTP placeholder variables and file matching
- Rename http.var.* -> http.vars.* to be more consistent
- Prefixing a path matcher with * now invokes simple suffix matching
- Handlers and matchers that need a root path default to {http.vars.root}
- Clean replacer output on the file matcher's file selection suffix
5 years ago
Matthew Holt
21d7b662e7
fastcgi: Use request context as base, not a new one
5 years ago
Matthew Holt
d2e46c2be0
fastcgi: Set default root path; add interface guards
5 years ago
Matthew Holt
80b54f3b9d
Add original URI to request context; implement into fastcgi env
5 years ago
Matthew Holt
0830fbad03
Reconcile upstream dial addresses and request host/URL information
My goodness that was complicated
Blessed be request.Context
Sort of
5 years ago
Matthew Holt
a60d54dbfd
reverse_proxy: Ignore context.Canceled errors
These happen when downstream clients cancel the request, but that's not
our problem nor a failure in our end
5 years ago
Matthew Holt
acb8f0e0c2
Integrate circuit breaker modules with reverse proxy
5 years ago
Matthew Holt
652460e03e
Some cleanup and godoc
5 years ago
Matthew Holt
4a1e1649bc
reverse_proxy: Implement remaining TLS config for proxy to backend
5 years ago
Matthew Holt
ccfb12347b
reverse_proxy: Implement active health checks
5 years ago
Matthew Holt
026df7c5cb
reverse_proxy: WIP refactor and support for FastCGI
5 years ago
Matthew Holt
c9980fd367
Refactor Caddyfile adapter and module registration
Use piles from which to draw config values.
Module values can return their name, so now we can do two-way mapping
from value to name and name to value; whereas before we could only map
name to value. This was problematic with the Caddyfile adapter since
it receives values and needs to know the name to put in the config.
6 years ago