Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/simia-tech/caddy-locale
Locale detection for caddy
https://github.com/simia-tech/caddy-locale
Last synced: 4 days ago
JSON representation
Locale detection for caddy
- Host: GitHub
- URL: https://github.com/simia-tech/caddy-locale
- Owner: simia-tech
- Created: 2016-05-07T13:52:23.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2020-02-18T10:09:29.000Z (over 4 years ago)
- Last Synced: 2024-08-04T09:02:55.781Z (3 months ago)
- Language: Go
- Size: 28.3 KB
- Stars: 8
- Watchers: 6
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Locale detection for caddy
## Configuration schema
locale {
detect
cookie
available
path
}A `method` can be currently `cookie` or `header`. If `cookie` is added, `cookie name` defines from which cookie the
locale is read. The `header` method extracts the locales from the `Accept-Language` header. The first `availableLocale`
is also the default locale, which is picked if none of the locales from the detection methods is in `availableLocales`.The defaults are: `methods = [header]`, `cookie name = locale`, `path scope = /`.
## Example
locale en de {
detect cookie header
}rewrite {
ext /
to index.{>Detected-Locale}.html index.html
}header / Vary "Cookie, Accept-Language"