I’ve been looking to replace WAMPServer as my development environment, as it is quite poor at serving assets correctly. In this endeavor Caddyserver seems optimal: HTTP/2, extremely lightweight, simple to set up with PHP, automatic HTTPS, simple virtual hosts, etc.
Setting Caddy up for Grav’s requirements were fairly straightforward, the problem is rather with the Caddyfile - ie. the server config - to correctly serve the files. I based my config on the repo one, though it needed a few tweaks to run on Windows.
I currently have two virtual hosts: Localhost and grav.dev, of which the former just runs phpinfo()
and the latter Grav 1.1-RC2. However, Caddy returns “No input file specified.” when visiting grav.dev, and I’m not quite sure why.
Here’s the Caddyfile, with tweaks added from 404 with Caddy server:
localhost:80 {
log logs/access.log
errors logs/error.log
gzip
star tup php-cgi -b 127.0.0.1:9000 &
fastcgi / 127.0.0.1:9000 php {
index index.php
}
}
# Grav
grav.dev:80 {
root /grav
log logs/access.log
errors logs/error.log
gzip
startup php-cgi -b 127.0.0.1:9000 &
fastcgi / 127.0.0.1:9000 {
ext .php
split .php
index index.php
}
rewrite {
regexp .*
ext /
to /index.php?_url={uri}
}
# Begin - Security
# deny all direct access for these folders
rewrite {
r /(.git|cache|bin|logs|backups|tests)/.*$
status 403
}
# deny running scripts inside core system folders
rewrite {
r /(system|vendor)/.*\.(txt|xml|md|html|yaml|php|pl|py|cgi|twig|sh|bat)$
status 403
}
# deny running scripts inside user folder
rewrite {
r /user/.*\.(txt|md|yaml|php|pl|py|cgi|twig|sh|bat)$
status 403
}
# deny access to specific files in the root folder
rewrite {
r /(LICENSE.txt|composer.lock|composer.json|nginx.conf|web.config|htacce ss.txt|\.htaccess)
status 403
}
## End - Security
# global rewrite should come last.
rewrite {
to {path} {path}/ /index.php?_url={uri}
}
}
Any thoughts on what might be wrong?