FreeScout Ticketing on Caddy

1. Caddy version (caddy version):

v2.3.0 h1:fnrqJLa3G5vfxcxmOH/+kJOcunPLhSBnjgIvjXV/QTA=

2. How I run Caddy:

a. System environment:

Caddyfile

a. System environment:

Debian 10 via systemd, installed using official Debian repo
PHP 7.4.14 (cli) (built: Jan 12 2021 13:59:46) ( NTS )

b. Command:

sudo systemctl start caddy

c. Service/unit/compose file:

[Unit]
Description=Caddy
Documentation=https://caddyserver.com/docs/
After=network.target network-online.target
Requires=network-online.target

[Service]
User=caddy
Group=caddy
ExecStart=/usr/bin/caddy run --environ --config /etc/caddy/Caddyfile
ExecReload=/usr/bin/caddy reload --config /etc/caddy/Caddyfile
TimeoutStopSec=5s
LimitNOFILE=1048576
LimitNPROC=512
PrivateTmp=true
ProtectSystem=full
AmbientCapabilities=CAP_NET_BIND_SERVICE

[Install]
WantedBy=multi-user.target

d. My complete Caddyfile or JSON config:

https://support.millhousen.tech {
        root * /var/www/html/support.millhousen.tech/public
        php_fastcgi unix//run/php/php7.4-fpm.sock
        encode gzip
        file_server
        log {
          output file /tmp/caddy.log
          format console
        }
}

3. The problem I’m having:

Site returns 500 Internal Server Errors

4. Error messages and/or full log output:

1.6112718672741082e+09 error http.log.access.log0 handled request {“request”: {“remote_addr”: “198.232.120.195:53742”, “proto”: “HTTP/2.0”, “method”: “GET”, “host”: “support.millhousen.tech”, “uri”: “/”, “headers”: {“Sec-Fetch-Dest”: [“document”], “Accept-Encoding”: [“gzip, deflate, br”], “User-Agent”: [“Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36”], “Accept”: [“text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.9”], “Sec-Gpc”: [“1”], “Sec-Fetch-Site”: [“none”], “Sec-Fetch-Mode”: [“navigate”], “Sec-Fetch-User”: ["?1"], “Accept-Language”: [“en-US,en;q=0.9”], “Upgrade-Insecure-Requests”: [“1”]}, “tls”: {“resumed”: false, “version”: 772, “cipher_suite”: 4865, “proto”: “h2”, “proto_mutual”: true, “server_name”: “support.millhousen.tech”}}, “common_log”: “198.232.120.195 - - [21/Jan/2021:23:31:07 +0000] “GET / HTTP/2.0” 500 591”, “duration”: 0.040016708, “size”: 591, “status”: 500, “resp_headers”: {“Content-Encoding”: [“gzip”], “Vary”: [“Accept-Encoding”], “Server”: [“Caddy”], “Cache-Control”: [“no-cache, private”], “Date”: [“Thu, 21 Jan 2021 23:31:07 GMT”], “Content-Type”: [“text/html; charset=UTF-8”], “Status”: [“500 Internal Server Error”]}}

5. What I already tried:

I tried searching for configs in order to match the Nginx config provided by the Freescout team (a Laravel app), but most of the time the discussion ended up simplifying the config to what I already have.

Maybe the Nginx config for Freescout is different than that of other Laravel apps?

6. Links to relevant resources:

HTTP status 500 errors will come from the app itself. I highly doubt it’s because of Caddy. Are you sure you have it correctly configured? Check your PHP logs. Laravel apps typically log to a storage/logs directory by default, so take a look there.

1 Like

I was missing a PHP plugin… :man_facepalming:

2 Likes

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