COPS with Caddy

COPS with Caddy

Has anyone used Caddy to run COPS?

https://github.com/seblucas/cops

If yes what does your caddy file look like?

If not could I get some help to create a caddy file? All they have is an example Nginx config:

https://github.com/seblucas/cops/wiki/Full-example-with-Nginx

Thank you

Hi @Smithoo4, give something really simple a shot and see how it goes.

example.com {
  root * /path/to/cops
  try_files {path} {path}/feed.php feed.php
  php_fastcgi localhost:9000
  file_server
}

try_files is the most complicated part about this, just because the nginx config specifies index feed.php (dunno why the program can’t simply use index.php as their index, but hey, whatever floats their boat).

1 Like

OK, I believe your recommendation is for Caddy v2. I am using Caddy v1.0.4 as that is what is installed by default on Arch. It took me longer to figure this out then I care to admit.

I was able to get COPS working on Caddy V1.0.4, or at least all the features I wanted as that is all I tested. Below is my caddy files, please feel free to criticize and suggest improvements.

 :80 {
        root /usr/share/cops
        fastcgi / unix:/run/php-fpm/php-fpm.sock php {
                feed feed.php
        }
}  

I guess sooner than later I should start looking into Caddy v2. For now, I am more interested in testing COPS and seeing if it will do what I am looking for.

Thank you for your help

No worries! Yeah, that’s a pretty straightforward v1 version of the v2 Caddyfile example I gave, looks good to me. Are you planning on making use of Automatic HTTPS at all?

Possibly in the future I may use the automatic HTTPS or have this behind a revers proxy that added HTTPS. Right now I just want to get COPS up and running, so I can evaluate it and see if it meets my needs as an ebook reader or if I should use one other ones out there like ubooquity. Why are you asking, is there something I should be looking out for?

Nope, nothing to look out for, just wondering why :80 instead of an actual address. Automatic HTTPS will kick off as soon as you throw a domain name in there for the site, it’s a killer feature and one of Caddy’s headlining capabilities.

Either way, though, Caddy should serve you well. Give us a yell back here at the forums if you run into any other trouble!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.