1. Output of caddy version
:
v2.5.2 h1:eCJdLyEyAGzuQTa5Mh3gETnYWDClo1LjtQm2q9RNZrs=
2. How I run Caddy:
sudo systemctl start caddy
a. System environment:
OS: Ubuntu 22.04
Built with: caddy-dns/cloudflare (91cf700356a1cd0127bcc4e784dd50ed85794af5)
b. Command:
sudo caddy stop && sudo caddy start ./Caddyfile
or
sudo systemctl restart caddy
c. Service/unit/compose file:
[Unit]
Description=caddy
After=network.target
[Service]
WorkingDirectory=/home/user/caddy
Environment=
Type=simple
User=root
ExecStart=/usr/bin/caddy run /home/user/caddy/Caddyfile
Restart=on-failure
[Install]
WantedBy=multi-user.target
d. My complete Caddy config:
{
acme_dns cloudflare <REDIACTED>
log {
output file /home/user/caddy/server.log
format console
}
}
onix.minjae.dev {
php_fastcgi unix//run/php/php8.1-fpm.sock php {
root /var/www/pterodactyl/public
index index.php
split ^(.+\.php)(/.+)$
try_files {uri} /index.php?{uri}
}
}
3. The problem I’m having:
I was moving the nginx configuration (full configuration) to Caddyfile, but I have trouble with try_files, how do I convert nginx’s
try_files $uri $uri/ /index.php?$query_string;
to caddy one?
(currently website only shows empty page)
4. Error messages and/or full log output:
N/A
5. What I already tried:
I’ve tried all things in the below links, but it seems they aren’t working.