This page is about Caddy 1 and will stay here forever.

User Guide


fastcgi proxies requests to a FastCGI server. Even though the most common use for this directive is to serve PHP sites, it is by default a generic FastCGI proxy. This directive may be used multiple times with different request paths.


fastcgi path endpoint [preset] { root directory ext extension split splitval index indexfile env key value except ignored_paths... upstream endpoint connect_timeout duration read_timeout duration send_timeout duration }

For HTTPS connections, the following environment variables are set, in a manner compliant with httpd's mod_ssl: HTTPS, SSL_PROTOCOL, and SSL_CIPHER.


A preset is shorthand for a certain FastCGI configuration. These presets are available:

You do not need to specify the individual configuration settings for a preset. However, you can overwrite its individual settings if needed by declaring them manually.


Proxy all requests to a FastCGI responder listening at

fastcgi /

Forward all requests in /blog to a PHP site (like WordPress) being served with php-fpm:

fastcgi /blog/ php

With custom FastCGI configuration:

fastcgi / { split .html }

With PHP preset, but overriding the ext property:

fastcgi / php { ext .html }

With PHP preset, but the FastCGI server is running in a container based on an official Docker image (with container port 9000 published to

fastcgi / php { root /var/www/html }

Need help with this feature?

Join us in the Caddy forum, where the open source community gathers to share their knowledge.

Does your company use Caddy?

Purchase a commercial license to use Caddy with your business and for basic email support, along with other benefits!