mirror of
https://github.com/caddyserver/website.git
synced 2025-04-21 12:36:16 -04:00
docs: Shorten the php_fastcgi expanded form a bit (#131)
Just making use of the matcher shortcuts we have available to make it look a little less fluffy.
This commit is contained in:
parent
e714536de1
commit
74db4350eb
1 changed files with 5 additions and 11 deletions
|
@ -53,26 +53,20 @@ The `php_fastcgi` directive is the same as the following configuration:
|
||||||
route {
|
route {
|
||||||
# Add trailing slash for directory requests
|
# Add trailing slash for directory requests
|
||||||
@canonicalPath {
|
@canonicalPath {
|
||||||
file {
|
file {path}/index.php
|
||||||
try_files {path}/index.php
|
|
||||||
}
|
|
||||||
not path */
|
not path */
|
||||||
}
|
}
|
||||||
redir @canonicalPath {path}/ 308
|
redir @canonicalPath {path}/ 308
|
||||||
|
|
||||||
# If the requested file does not exist, try index files
|
# If the requested file does not exist, try index files
|
||||||
@indexFiles {
|
@indexFiles file {
|
||||||
file {
|
|
||||||
try_files {path} {path}/index.php index.php
|
try_files {path} {path}/index.php index.php
|
||||||
split_path .php
|
split_path .php
|
||||||
}
|
}
|
||||||
}
|
|
||||||
rewrite @indexFiles {http.matchers.file.relative}
|
rewrite @indexFiles {http.matchers.file.relative}
|
||||||
|
|
||||||
# Proxy PHP files to the FastCGI responder
|
# Proxy PHP files to the FastCGI responder
|
||||||
@phpFiles {
|
@phpFiles path *.php
|
||||||
path *.php
|
|
||||||
}
|
|
||||||
reverse_proxy @phpFiles <php-fpm_gateway> {
|
reverse_proxy @phpFiles <php-fpm_gateway> {
|
||||||
transport fastcgi {
|
transport fastcgi {
|
||||||
split .php
|
split .php
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue