1. Caddy version (caddy version
):
v2.4.3
2. How I run Caddy:
Via official docker image
a. System environment:
Ubuntu 20.04.1
Docker 20.10.7
b. Command:
c. Service/unit/compose file:
version: "3.7"
services:
caddy:
image: caddy
container_name: caddy
hostname: caddy
restart: unless-stopped
ports:
- "80:80"
- "443:443"
environment:
- MY_DOMAIN
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile:ro
- ./data:/data
- ./config:/config
networks:
default:
external:
name: $DOCKER_MY_NETWORK
d. My complete Caddyfile or JSON config:
{
# acme_ca https://acme-staging-v02.api.letsencrypt.org/directory
}
docker.{$MY_DOMAIN} {
reverse_proxy portainer:9000
}
rss.{$MY_DOMAIN} {
root * /var/www/ttrss
php_fastcgi unix//var/run/php/php7.4-fpm.sock {
index index.php
}
file_server
}
3. The problem I’m having:
I have an existing installation of a PHP app (Tiny Tiny RSS) at /var/www/ttrss . I was using using NGINX as my reverse proxy and the following config was working for me:
upstream php-handler {
server unix:/var/run/php/php7.4-fpm.sock;
}
server {
listen 80;
listen [::]:80;
server_name rss.domain.name;
return 301 https://$server_name:443$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name rss.domain.name;
root /var/www/ttrss;
index index.php;
include snippets/ssl-defaults.conf;
error_log /var/log/nginx/ttrss.error.log;
access_log /var/log/nginx/ttrss.access.log;
location / {
try_files $uri $uri/ /index.php;
}
location ~ \.php$ {
include fastcgi.conf; # don't use fastcgi_params
fastcgi_pass php-handler;
fastcgi_index index.php;
}
}
I am trying to port this to Caddy, and my attempt so far can be seen in the caddyfile above. However it doesn’t seem to work and I am getting a blank page when I visit the url.
4. Error messages and/or full log output:
I do not have any error message. I just see a blank page when I visit the url.
5. What I already tried:
I have tried to write a caddyfile which can be seen above. But it’s possible that it’s not a complete port of the working NGINX config.
Another possible reason for it not working that I can think of, is that Caddy doesn’t have enough permission. But I am not sure what user it runs as.