Nextcloud not dockerized with php_fastcgi php-fpm.sock

1. Output of caddy version:

v2.6.2 h1:wKoFIxpmOJLGl3QXoo6PNbYvGW4xLEgo32GPBEjWL8o=

2. How I run Caddy:

Install caddy via apt and run using systemd

a. System environment:

Description: Ubuntu 20.04.5 LTS
Release: 20.04
Codename: focal
systemd
php 8.1
nextcloud 24.0.6

b. Command:

systemctl [start/stop/restart/status] caddy

c. Service/unit/compose file:

default  package unit file

d. My complete Caddy config:

cloud-bkp.die-kinderwelt.com {
            encode gzip

            log {
                output file /var/log/caddy/nextcloud.log
            }
            root * /var/www/nextcloud
            file_server
            php_fastcgi unix//run/php/php-fpm.sock {
                env front_controller_active true # Remove index.php form url
                header_up -X-Forwarded-Host
            }

            header {
                Strict-Transport-Security max-age=15768000;
           }

            redir /.well-known/carddav https://cloud-bkp.die-kinderwelt.com/remote.php/dav/ permanent
            redir /.well-known/caldav https://cloud-bkp.die-kinderwelt.com/remote.php/dav/ permanent

            @phpFiles {
                    path_regexp phpfile ^/(remote|public|cron|core/ajax/update|status|ocs/v1|ocs/v2)\.php
            }
            rewrite @phpFiles {http.regexp.phpfile.0}

            rewrite /index.php/* /index.php${uri}

            # .htaccess / data / config / ... shouldn't be accessible from outside
            @forbidden {
                    path /build/*
                    path /tests/*
                    path /config/*
                    path /lib/*
                    path /3rdparty/*
                    path /templates/*
                    path /data/*
                    path /.
                    path /autotest
                    path /occ
                    path /issue
                    path /indie
                    path /db_
                    path /console
            }

            respond @forbidden 404 {
                close
            }

            handle_errors {
                respond "{err.status_code} {err.status_text}"
            }
}

3. The problem I’m having:

Hey there,
everything seems to run fine with the above caddy conf.
I just wanted to know if anyone has suggestions for optimizations.
I want to make sure to follow best practices.

Thanks!

4. Error messages and/or full log output:

5. What I already tried:

6. Links to relevant resources:

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