You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/best-practices/deployment.md
+117-1Lines changed: 117 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ provides even more awesome features with its built-in web server.
10
10
No matter what existing PHP stack you're using, X runs anywhere.
11
11
This means that if you've already used PHP before, X will *just work*.
12
12
13
-
* nginx with PHP-FPM
13
+
* nginx or Caddy with PHP-FPM
14
14
* Apache with PHP-FPM, mod_fcgid, mod_cgi or mod_php
15
15
* Any other web server using FastCGI to talk to PHP-FPM
16
16
* Linux, Mac and Windows operating systems (<abbrevtitle="Apache, MySQL or MariaDB, PHP, on Linux, Mac or Windows operating systems">LAMP, MAMP, WAMP</abbrev>)
@@ -100,6 +100,65 @@ $ curl http://localhost/
100
100
Hello wörld!
101
101
```
102
102
103
+
### Caddy
104
+
105
+
Caddy is an extensible, cross-platform, open-source web server written in Go.
106
+
Many projects use Caddy because of its ease of use in configuration, and its
107
+
headlining feature, Automatic HTTPS, which provisions TLS certificates for your
108
+
sites and keeps them renewed.
109
+
110
+
X supports Caddy out of the box. If you've used Caddy before to run any PHP
111
+
application, using Caddy with X is as simple as dropping the project files in
112
+
the right directory. Accordingly, this guide assumes you want to process a
113
+
number of [dynamic routes](../api/app.md#routing) through X and optionally
114
+
include some public assets (such as style sheets and images).
115
+
116
+
> ℹ️ **PHP-FPM or reverse proxy?**
117
+
>
118
+
> This section assumes you want to use Caddy with PHP-FPM which is a very common,
119
+
> traditional web stack. If you want to get the most out of X, you may also
120
+
> want to look into using the built-in web server with
121
+
> [Caddy's reverse proxy](#caddy-reverse-proxy).
122
+
123
+
Assuming you've followed the [quickstart guide](../getting-started/quickstart.md),
124
+
all you need to do is to point Caddy's [`root` directive](https://caddyserver.com/docs/caddyfile/directives/root)
125
+
to the `public/` directory of your project. On top of this, you'll need
126
+
to instruct Caddy to process any dynamic requests through X. This can be
127
+
achieved by using an `Caddyfile` configuration with the following contents:
0 commit comments