Example: YOURLS

If you want to use the URL shortener service YOURLS, you have to use a special configuration in order to make it work with Caddy 2.

Here’s the minimum Caddyfile configuration you will need :

domain.com {
    root * /var/www/yourls
    route {
        try_files {path} {path}/index.php yourls-loader.php
        php_fastcgi unix//run/php/php-version-fpm.sock
    }
    file_server 
}

Don’t forget to change the configuration :

  • domain.com with your domain name ;
  • /var/www/yourls with the actual path where you installed YOURLS ;
  • unix//run/php/php-version-fpm.sock with the correct php-fpm sock path.
5 Likes