1. The problem I’m having:
I will be brief here with the explanation because it has been 2 years on this and now I have an opportunity to show caddyserver. I have a client that has about 50 domains all inside a server. He has several developers that are very reluctant to use caddyserver on the server, to the point that they only use Apache because it comes by default with Cpanel / WHMCS.
Currently they changed from CentOS to Ubuntu with the Cpanel server. I am trying to run Caddy on the server, but every time the domain is access, cpanel is the one that grabs it first before caddyserver even sees the traffic. How can I do something along the lines of:
Hey Cpanel, do not handle THIS specific sub domain or domain and let caddyserver handle it.
Can Caddyserver work together in a server that apache is also in?
The Caddyserver configuration is like this:
{
http_port 8080
https_port 8443
}
api.testsite.com {
# Set this path to your site's directory.
root * /var/www/api
tls luisalvaradox@gmail.com
# Enable the static file server.
header Access-Control-Allow-Origin "*"
header Access-Control-Allow-Methods "POST, GET, OPTIONS, PUT, DELETE"
header Access-Control-Allow-Headers "*"
header Server "CaddyServer 1.0"
file_server
encode gzip zstd
# Another common task is to set up a reverse proxy:
# reverse_proxy localhost:8080
# Or serve a PHP site through php-fpm:
try_files {path} {path}/index.php
php_fastcgi unix//opt/cpanel/ea-php81/root/usr/var/run/23450a7cf9fcb8aeaf115a274c59fb54f0db770d.sock
# Refer to the Caddy docs for more information:
# https://caddyserver.com/docs/caddyfile
@cachedFiles {
path *.ico *.css *.js *.gif *.jpg *.jpeg *.png *.webp *.svg *.woff *.woff2
}
header @cachedFiles Cache-Control max-age=31536000
}
2. Error messages and/or full log output:
PASTE OVER THIS, BETWEEN THE ``` LINES.
Please use the preview pane to ensure it looks nice.
3. Caddy version:
Caddy version is 2.7.6
4. How I installed and ran Caddy:
a. System environment:
from the PPA it was installed.
b. Command:
PASTE OVER THIS, BETWEEN THE ``` LINES.
Please use the preview pane to ensure it looks nice.
c. Service/unit/compose file:
PASTE OVER THIS, BETWEEN THE ``` LINES.
Please use the preview pane to ensure it looks nice.
d. My complete Caddy config:
PASTE OVER THIS, BETWEEN THE ``` LINES.
Please use the preview pane to ensure it looks nice.