The Wayback Machine - https://web.archive.org/web/20160310164132/https://caddyserver.com/docs/fastcgi

fastcgi

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.

Syntax

fastcgi path endpoint [preset] { ext extension split splitval index indexfile env key value }

Presets

This directive can be customized to work with a variety of FastCGI applications. To make things easier for proxying to common types of sites, some presets have been configured:

If a preset is used, its values can be overwritten if needed by declaring them manually inside the block.

Examples

Proxy all requests to a FastCGI responder listening at 127.0.0.1:9000:

fastcgi / 127.0.0.1:9000

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

fastcgi /blog 127.0.0.1:9000 php

With custom FastCGI configuration:

fastcgi / 127.0.0.1:9001 { split .html }

With PHP preset, but overriding the ext property:

fastcgi / 127.0.0.1:9001 php { ext .html }
Open Support Chat