Caddy configuration file error

1. Caddy version (caddy version):

2

a. System environment:

centos7

b. Command:

caddy

d. My complete Caddyfile or JSON config:

/etc/caddy/Caddyfile

abc {
    gzip
timeouts none
    proxy / {
        except /
    }
    proxy /127.0.0.1:10086 {
        without /
        websocket
    }
}
import sites/*

The problem lies in this file

/etc/caddy/Caddyfile

abc {
    gzip
    tls abc
    root * /www/wwwroot/tg
    php_fastcgi unix/ /tmp/php-cgi-73.sock
    file_server
}

4. Error messages and/or full log output:

[root caddy]# vim sites/Caddyfile
[root caddy]# caddy
2021/10/22 09:50:52 /etc/caddy/sites/Caddyfile:5 - Error during parsing: Unknown directive 'file_server'
[root caddy]# vim sites/Caddyfile
[root caddy]# caddy
2021/10/22 09:51:53 /etc/caddy/sites/Caddyfile:6 - Error during parsing: Unknown directive 'php_fastcgi'

Both your Caddyfiles are at /etc/caddy/Caddyfile?

I think you’re using Caddy v1, that is no longer supported. What is the exact output of caddy version as requested?

I think the version should be 1. Is there a problem with the version? Can I smoothly upgrade to version 2

Yeah, upgrading would be a really good idea at this point. It should go pretty smoothly given what you’re doing. Follow our upgrade guide carefully:

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