0
Fork 0
mirror of https://github.com/caddyserver/caddy.git synced 2024-12-23 22:27:38 -05:00
caddy/README.md

76 lines
2.7 KiB
Markdown
Raw Normal View History

2015-01-13 15:24:43 -05:00
Meet caddy
===========
2015-01-13 17:45:08 -05:00
Caddy is a web server for your files like Apache, nginx, or lighttpd, but with different goals, features, and advantages.
2015-01-13 15:24:43 -05:00
2015-03-25 23:48:28 -05:00
*Note:* This software is pre-1.0 and under rapid development. Don't use it in production (yet).
2015-01-13 15:24:43 -05:00
2015-01-21 21:16:31 -05:00
### Features
2015-03-25 23:48:28 -05:00
- HTTP/1.1 and HTTP/2
2015-03-03 13:14:36 -05:00
- TLS
2015-03-25 23:48:28 -05:00
- FastCGI
2015-03-03 13:14:36 -05:00
- WebSockets
2015-03-25 23:48:28 -05:00
- Markdown
2015-03-03 13:14:36 -05:00
- IPv4 and IPv6 support
2015-01-21 21:16:31 -05:00
- Gzip
2015-03-03 13:14:36 -05:00
- Custom headers
2015-01-21 21:16:31 -05:00
- Logging
2015-03-03 13:14:36 -05:00
- Rewrites
- Redirects
2015-01-21 21:16:31 -05:00
- Multi-core
2015-03-03 13:14:36 -05:00
- + more
2015-01-13 15:24:43 -05:00
2015-03-25 23:48:28 -05:00
Caddy is designed to be super-easy to use and configure. Full documentation coming soon.
2015-01-21 21:16:31 -05:00
2015-03-25 23:48:28 -05:00
### Run Caddy in 10 Seconds
2015-01-13 15:24:43 -05:00
2015-03-25 23:48:28 -05:00
1. Run `go get github.com/mholt/caddy`
2. `cd` into your website's directory
3. Run `caddy` (assumes `$GOPATH/bin` is in your `$PATH`)
2015-01-13 15:24:43 -05:00
2015-01-21 21:16:31 -05:00
Caddy will, by default, serve the current working directory on [http://localhost:8080](http://localhost:8080) (the default port will change before version 1.0).
2015-01-13 15:24:43 -05:00
2015-03-25 23:48:28 -05:00
When announced, there will be builds of Caddy available for all platforms.
2015-01-13 15:24:43 -05:00
### Configuring Caddy
2015-03-25 23:48:28 -05:00
Use a Caddyfile to configure Caddy. If the current directory has a file called `Caddyfile`, it will be loaded and parsed and used as configuration. Or you can specify the location of the file using the `-conf` flag.
2015-01-13 15:24:43 -05:00
2015-03-03 13:14:36 -05:00
A Caddyfile always starts with an address to bind to. The rest of the lines are configuration directives. Here's an example:
2015-01-13 15:24:43 -05:00
```
mydomain.com:80
gzip
ext .html
header /api Access-Control-Allow-Origin *
2015-03-25 23:48:28 -05:00
browse /files /home/myuser/template.tpl
2015-01-13 15:24:43 -05:00
```
2015-03-25 23:48:28 -05:00
This simple file enables compression, serves clean URLs, adds the coveted `Access-Control-Allow-Origin: *` header to all requests starting with `/api`, and enables file browsing in `/files` using a custom HTML template. Wow! Caddy can do a lot with just a few lines.
2015-01-13 15:24:43 -05:00
2015-01-13 17:45:08 -05:00
Maybe you want to serve both HTTP and HTTPS. You can define multiple (virtual) hosts using curly braces:
2015-01-13 15:24:43 -05:00
```
mydomain.com:80 {
gzip
ext .html
}
mydomain.com:443 {
tls cert.pem key.pem
}
```
2015-03-25 23:48:28 -05:00
More documentation and rigorous tests are on their way as this program matures and leaves the experimental phase. Lots of refinements are planned and well on their way to becoming a reality.
2015-01-13 17:45:08 -05:00
2015-01-13 15:24:43 -05:00
### Contributing
2015-03-25 23:48:28 -05:00
Please get involved! Before adding a new feature or changing existing behavior, open an issue to discuss it. For non-breaking changes and bug fixes, pull requests are accepted. You can also drop a quick [tweet to @mholt6](https://twitter.com/mholt6) for quick feedback or comments.
2015-03-03 13:14:36 -05:00
### About the project
2015-03-25 23:48:28 -05:00
Caddy was born out of the need for a "batteries-included" web server that runs anywhere and doesn't have to take its configuration with it. Caddy took some inspiration from nginx, lighttpd, Websocketd, and Vagrant, and provides a pleasant mixture of features from each of them. Once announced, Caddy will be suitable for use in both dev and production environments.