docs: Some random polish (#241)

* docs: Some random polish

Just a bunch of little things that I think would help users from frequently asked forum questions.

* Adjustments, fix `tls_server_name` docs

* Update src/docs/markdown/caddyfile/concepts.md

Co-authored-by: Matt Holt <mholt@users.noreply.github.com>

Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
This commit is contained in:
Francis Lavoie 2022-06-06 14:36:50 -04:00 committed by GitHub
parent 8f61c3c71f
commit 655786d85e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 45 additions and 28 deletions

View file

@ -96,7 +96,7 @@ example.com {
```
To remove it for **multiple domains** at once:
To remove it for **multiple domains** at once; this uses the `{labels.*}` placeholders which are the parts of the hostname, 0-indexed from the right (e.g. 0=com, 1=example-one, 2=www):
```caddy
www.example-one.com, www.example-two.com {
@ -180,11 +180,12 @@ When a web page does its own routing, servers may receive lots of requests for p
The main idea is to have the server "try files" to see if the requested file exists server-side, and if not, fall back to an index file where the client does the routing (usually with client-side JavaScript): `try_files {path} /index.html`
The most basic SPA config usually looks something like this:
A typical SPA config usually looks something like this:
```caddy
example.com {
root * /path/to/site
encode gzip
try_files {path} /index.html
file_server
}
@ -194,6 +195,8 @@ If your SPA is coupled with an API or other server-side-only endpoints, you will
```caddy
example.com {
encode gzip
handle /api/* {
reverse_proxy backend:8000
}