mirror of
https://github.com/caddyserver/caddy.git
synced 2025-01-22 10:25:46 +03:00
FastCGI: allow "unix:" prefix for unix sockets.
This commit is contained in:
parent
1cb0053720
commit
820b2af43a
1 changed files with 4 additions and 1 deletions
|
@ -61,7 +61,10 @@ func (h Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, error)
|
||||||
var fcgi *FCGIClient
|
var fcgi *FCGIClient
|
||||||
|
|
||||||
// check if unix socket or tcp
|
// check if unix socket or tcp
|
||||||
if strings.HasPrefix(rule.Address, "/") {
|
if strings.HasPrefix(rule.Address, "/") || strings.HasPrefix(rule.Address, "unix:") {
|
||||||
|
if strings.HasPrefix(rule.Address, "unix:") {
|
||||||
|
rule.Address = rule.Address[len("unix:"):]
|
||||||
|
}
|
||||||
fcgi, err = Dial("unix", rule.Address)
|
fcgi, err = Dial("unix", rule.Address)
|
||||||
} else {
|
} else {
|
||||||
fcgi, err = Dial("tcp", rule.Address)
|
fcgi, err = Dial("tcp", rule.Address)
|
||||||
|
|
Loading…
Reference in a new issue