I would really like Caddy v2 to be able to send fastcgi scripts to handlers via fastcgi interface, just like Caddy v1.
Hence fastcgi implementation would be awesome.
In order for Caddy v2 to become the go-to webserver for the GO community, in my opinion being able to host sites based on cgi scripts is a must-have feature for Caddy v2.
None at the moment, because Caddy v2 does not yet support third party modules/plugins.
Funny you should ask, I heard through the grapevine that that's the next thing @mholt is about to look into implementing! 馃帀
A very rough but sort-of-working FastCGI implementation is in #2737. It probably won't work with some/most PHP apps yet but in theory it can at least do roundtrips with fastcgi backends. Feel free to give it a go! Just set the reverse_proxy's transport to use FastCGI:
"transport": {"protocol": "fastcgi"}
Other options are available but I haven't gotten around to fully integrating them yet. Still, it's sort-of usable.
This is now working in #2737. Caddyfile integration is also there, but I want to add a shortcut for PHP apps so that the necessary rewrites and matchers for PHP to work are hidden, since that'll be very common. That'll probably come in a separate PR.
Awesome work!
Though when I build caddy v2 from v2 branch, I get the following error:
$ git clone -b v2 "https://github.com/caddyserver/caddy.git" v2caddy
Klone nach 'v2caddy' ...
remote: Enumerating objects: 18467, done.
remote: Total 18467 (delta 0), reused 0 (delta 0), pack-reused 18467
Empfange Objekte: 100% (18467/18467), 10.97 MiB | 5.45 MiB/s, Fertig.
L枚se Unterschiede auf: 100% (11272/11272), Fertig.
$ cd v2caddy/cmd/caddy/
$ ls
main.go
$ go build
# github.com/caddyserver/caddy/v2/modules/caddyhttp
../../modules/caddyhttp/server.go:190:20: undefined: caddy.ParseListenAddr
$ ls
main.go
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/hnrk/.cache/go-build"
GOENV="/home/hnrk/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/hnrk/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/hnrk/go1.13/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/hnrk/go1.13/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/etc/buildv2caddy/v2caddy/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build194970707=/tmp/go-build -gno-record-gcc-switches"
I also cleared the modules and pkg folder for Caddy v2 to redownload the modules, still the same issue.
@Henrocker Oops, fixed; thanks. Guess my editor's Go plugin still isn't up to snuff with modules yet.
Most helpful comment
Funny you should ask, I heard through the grapevine that that's the next thing @mholt is about to look into implementing! 馃帀