Jump to content

Caddy: Difference between revisions

474 bytes added ,  30 January 2023
Add example for PHP Fastcgi
imported>Onny
mNo edit summary
imported>Onny
(Add example for PHP Fastcgi)
Line 55: Line 55:
};   
};   
</nowiki>}}
</nowiki>}}
=== Redirect ===
=== Redirect ===


Line 67: Line 68:
};
};
</syntaxhighlight>
</syntaxhighlight>
=== PHP FastCGI ===
Serving a PHP application in <code>/var/www</code> on <code>localhost</code>.
<syntaxhighlight lang="nix>
services.caddy = {
  enable = true;
  virtualHosts."http://localhost" = {
    extraConfig = ''
      root    * /var/www
      file_server
      php_fastcgi unix/var/run/phpfpm/localhost.sock
    '';
  };
};
</syntaxhighlight>
You'll need a [[Phpfpm|PHP-FPM]] socket listening on Unix socket path <code>/var/run/phpfpm/localhost.sock</code>.
== See also ==
== See also ==
* [https://caddyserver.com/docs/ Official Caddy documentation]
* [https://caddyserver.com/docs/ Official Caddy documentation]


[[Category:Applications]]
[[Category:Applications]]
[[Category:Web Servers]]
[[Category:Web Servers]]
Anonymous user