You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
861 B
Caddyfile
39 lines
861 B
Caddyfile
(trans) {
|
|
try_files {http.regexp.locale.1}/{path} {http.regexp.locale.1}/{path}/index.html {path}
|
|
file_server
|
|
}
|
|
|
|
(static) {
|
|
@locale_accept_language {
|
|
header_regexp locale accept-language (?:(?:\A|,\s*)(pl|sr|hu|fa|no|cs|ar|sv|ach|it|gl|ja|nl|es|el|de|pt|he|tr|ru|sat|eo|uk|en|ko|af|da|fi|ro|fr|zh|ca|vi)\b)
|
|
}
|
|
@locale_cookie {
|
|
header_regexp locale cookie \Alocale=(\w\w).*
|
|
}
|
|
|
|
header vary accept-language
|
|
handle @locale_cookie {
|
|
import trans
|
|
}
|
|
handle @locale_accept_language {
|
|
import trans
|
|
}
|
|
file_server
|
|
}
|
|
|
|
(ach) {
|
|
try_files ach/{path} ach/{path}/index.html {path}
|
|
file_server
|
|
}
|
|
|
|
docs.joinplu.me {
|
|
import static
|
|
root * /usr/share/caddy/docs.joinplu.me/build
|
|
}
|
|
|
|
translate.docs.joinplu.me {
|
|
import ach
|
|
root * /usr/share/caddy/translate.docs.joinplu.me/build
|
|
}
|
|
|