finished README update with caddy config
This commit is contained in:
parent
8d5557880d
commit
09b773ca65
1 changed files with 19 additions and 19 deletions
38
README.md
38
README.md
|
@ -10,26 +10,26 @@ After production build, optionally remove the empty, 0-byte app.js script tags f
|
||||||
|
|
||||||
### caddy example
|
### caddy example
|
||||||
|
|
||||||
This could probably be optimized but it's working:
|
With this snippet in the Caddyfile, for a site one can `import err` to handle errors for that site.
|
||||||
|
|
||||||
```
|
```
|
||||||
# Custom Unicorn Rainbow error pages
|
(err) {
|
||||||
location /err_css {
|
root /err_css/* /www/err
|
||||||
root /var/www/err;
|
root /err_images/* /www/err
|
||||||
autoindex off;
|
respond /unknown_error_not_4xx_not_5xx "{http.error.status_code} {http.error.status_text}"
|
||||||
expires max;
|
|
||||||
}
|
handle_errors {
|
||||||
location /err_images {
|
@4xx expression `{http.error.status_code} >= 400 && {http.error.status_code} < 500`
|
||||||
root /var/www/err;
|
@5xx expression `{http.error.status_code} >= 500 && {http.error.status_code} < 600`
|
||||||
autoindex off;
|
|
||||||
expires max;
|
root * /www/err
|
||||||
}
|
encode zstd gzip
|
||||||
error_page 403 404 /40x.html;
|
file_server
|
||||||
location = /40x.html {
|
|
||||||
root /var/www/err;
|
rewrite @4xx /4xx.html
|
||||||
}
|
rewrite @5xx /5xx.html
|
||||||
error_page 500 502 503 504 /50x.html;
|
rewrite * /unknown_error_not_4xx_not_5xx
|
||||||
location = /50x.html {
|
templates
|
||||||
root /var/www/err;
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in a new issue