Open STaRDoGG opened 5 years ago
Since you're not changing anything other than plugins, why not just
export PLUGINS="dyndns,service,authz,cache,cgi,cors,expires,filebrowser,filter,forwardproxy,geoip,git,gopkg,grpc,ipfilter,jwt,locale,login,mailout,minify,nobots,proxyprotocol,ratelimit,realip,reauth,upload,webdav,net,cloudflare"
# build
docker build --name myname/caddy --build-arg \
plugins="$PLUGINS" \
github.com/abiosoft/caddy-docker.git
@abiosoft I've done a few other things to the Dockerfile as well. I went back to my original post and put an asterisk in front of all my changes.
@abiosoft Any ideas? I'm still wrassling with this, lol.
It's been a few months so I don't suppose you're struggling with this/a "noob" anymore, but if you still need help (I'm curious too)
Do you have the log output from these 3 requests?
/srv # curl -l 127.0.0.1:1234
Client sent an HTTP request to an HTTPS server.
/srv # curl 127.0.0.1:1234
Client sent an HTTP request to an HTTPS server.
/srv # curl https://my.domain.rocks:1234
curl: (7) Failed to connect to my.domain.rocks port 1234: Operation timed out
I'm guessing the first two will say something like "hostname not served on this port", but I'm curious to see why the last one is timing out.
@jeslinmx thanks for showing an interest. :)
I ended up throwing in the towel on Caddy (underneath it's 'easy' facade, it's a real PITA to get everything up and running quickly, smoothly, and reliably), and went with Nginx (in the Linuxserver.io's LetsEncrypt container), and it's been smooth sailing ever since. They even have pre-built reverse-proxy configs for a all of the common services built right into the container; you just have to rename a file and it'll work.
If I do ever revisit this issue, (and you're still interested at that point), I'll post a follow-up here.
Ah. I figured as much. Out of curiosity, how do you find nginx as a reverse proxy compares to, say, caddy and traefik in terms of learning curve? Especially if you want to do something beyond just proxying (for instance, basic auth).
Also, FWIW I believe that caddyV2 is currently in the works. Seems like they did away partially with the "easy" facade, although I have yet to read the docs enough to see whether it was accompanied with greater reliability and configurability. Perhaps when it releases, you might be interested to revisit caddy.
@jeslinmx To be honest, I've never used Traefik at all (yet, but I've been curious about it), so I can't really say how that fits in, but compared to Caddy, the Caddy syntax is slightly easier to grasp, but not really that much if you're even just moderately experienced in coding. And for the most part, there's been very little actual coding (myself) involved when using the LinuxServer container; they've done such an excellent job with it, it's all almost ready to go right out of the box. Not much of a learning curve, IMO. I think that's probably the biggest difference; with Caddy, you're still left to hand code everything in your caddyfile, while in this Nginx container, It's all pretty much ready to go out of the box. You just go into it's reverse proxy folder, which is full of a ton of configs for services, and rename whichever ones you need. Restart the container, and you're ready to go. (Assuming you've already setup your other service containers; i.e. Ombi, Tautulli, etc.)
Regarding basic auth, I've never done that with nginx either (yet), I've just not had any need to as of yet. Though, I don't think it would be very tricky at all.
Thanks, cheers!
Anyone able to point out what I'm doing wrong? This is the first time I've ever built my own Docker image. (well, built it with abio's template).
After starting the container, I just can't connect to the site that I've setup for a reverse proxy.
Here's my slightly altered Dockerfile:
It builds fine (docker build . -t myname/caddy). Then I run it with:
docker run -p 1234:1234-e CLOUDFLARE_API_KEY=23432432432432432432434 -e CLOUDFLARE_EMAIL=myemail@gmail.com -d --name caddy myname/caddy
It starts up fine, the main log shows:
So then I try to load up https://my.domain.rocks:1234 and nothing. "ERR_CONNECTION_TIMED_OUT", "This site can’t be reached".
I SSH into the container and do:
My Caddyfile in the container looks like this:
Not really much of a Linux guru, and still pretty new to Docker, so not sure why it's not connecting. I use the same caddyfile minus the way that PHP is called, on a non-docker Caddy and it works fine, so it seems like it should be working, but doesn't.