caddyserver/nginx-adapter

Unrecognized Config Adapter

marfier opened this issue · 4 comments

Hi,

Caddy is not recognizing the adapter. I have done go get github.com/caddyserver/nginx-adapter, went to nginx-adapter, and done go build, according to the instructions, yet it's still not recognized when I do root@dynmc:~# caddy run --config Caddyfile --adapter nginx 2020/02/22 16:00:25.857 INFO using provided configuration {"config_file": "Caddyfile", "config_adapter": "nginx"} run: unrecognized config adapter: nginx root@dynmc:~# caddy run --config Caddyfile --adapter nginx.

Thank you.

mholt commented

That's half of it, but you need to follow the instructions in the README: https://github.com/caddyserver/nginx-adapter#install

The Caddy README also describes how to build with plugins: https://github.com/caddyserver/caddy/tree/v2#building-with-plugins

Hi,

By the instructions, I meant the README.md. As the README.md states, I have gotten this module using Go (go get github.com/caddyserver/nginx-adapter), went into the nginx-adapter directory, and run go build. It said that it completed, but when I did caddy run --config /opt/Caddyfile --adapter nginx, it said that it is not recognized.

Thank you.

mholt commented

@GalacticLion7 No, you skipped this README.md's instructions:

To compile, simply go build Caddy 2 with this adapter plugged in. Add this to the list of imports:

  _ "github.com/caddyserver/nginx-adapter"

This isn't specific to this adapter, that's just how you build Caddy 2 from source, with custom plugins. Which is described in the Caddy 2 readme. You can't skip this step :)

The helper script solves it all. Thanks!