Answers.Body: <p>For local development the <code>Caddyfile</code> looks like this (assuming that php-fpm runs on port 9000, you may have to adapt <code>root</code> to point to your web root relative to the location of the <code>Caddyfile</code>):</p>
  
  <pre><code>localhost:2020 {
      root public_html
      fastcgi / 127.0.0.1:9000 php
      rewrite {
          r .*
          to {uri} {uri}/ /index.php?p={uri}&amp;{query} /index.php?{query}
      }
  }
  </code></pre>
  
  <p><strong>Edit:</strong> For Caddy <code>&gt;= 0.9.x</code> the <code>rewrite</code> has to be changed to this:</p>
  
  <pre><code>rewrite {
    to {path} {path}/ /index.php?p={path}&amp;{query} /index.php?{query}
  }
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-07-25T02:54:18.053Z
Answers.Text: Have you noticed any issues with running tasks with Caddy server? I've noticed that even P&T's own PowerNap task example doesn't run properly on Caddy.
Answers.UserDisplayName: Chase Giunta
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-19T21:55:30.923Z
Answers.LastActivityDate: 2016-09-13T19:08:02.780Z
Answers.LastEditDate: 2016-09-13T19:08:02.780Z
Answers.UserDisplayName: Lars Bilke
Body: <p><a href="https://caddyserver.com" rel="noreferrer">Caddy</a> seems to be an easy to use alternative to established web servers. How does the <code>Caddyfile</code> look like for a Craft site?</p>
  
Tags: <server><caddy>
Title: How to serve Craft with Caddy server
ThreadText: # How to serve Craft with Caddy server
  
  (Asked by: username_0 on 2016-03-19)
  
  [Caddy](https://caddyserver.com) seems to be an easy to use alternative to established web servers. How does the `Caddyfile` look like for a Craft site?
  
  **Tags:** server, caddy
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2016-03-19. Score: 4 | Accepted answer
  
  For local development the `Caddyfile` looks like this (assuming that php-fpm runs on port 9000, you may have to adapt `root` to point to your web root relative to the location of the `Caddyfile`):
  
  ```
  localhost:2020 {
      root public_html
      fastcgi / 127.0.0.1:9000 php
      rewrite {
          r .*
          to {uri} {uri}/ /index.php?p={uri}&{query} /index.php?{query}
      }
  }
  
  ```
  
  **Edit:** For Caddy `>= 0.9.x` the `rewrite` has to be changed to this:
  
  ```
  rewrite {
    to {path} {path}/ /index.php?p={path}&{query} /index.php?{query}
  }
  
  ```
  
  > **Comments:**
  > **username_1**: Have you noticed any issues with running tasks with Caddy server? I've noticed that even P&T's own PowerNap task example doesn't run properly on Caddy.  
  
  ---
  
  