mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-26 17:34:11 -05:00
474dfcc798
original PR go-gitea/docs#147 and author @0xbaadf00d
44 lines
553 B
Text
44 lines
553 B
Text
:80 {
|
|
root /srv/www
|
|
|
|
locale en-US zh-CN zh-TW pt-BR nl-NL fr-FR {
|
|
detect header
|
|
}
|
|
|
|
redir 301 {
|
|
if {path} match ^/$
|
|
/ /{>Detected-Locale}/
|
|
}
|
|
|
|
rewrite /en-US/ {
|
|
regexp (.*)
|
|
to /en-us/{1}
|
|
}
|
|
|
|
rewrite /zh-CN/ {
|
|
regexp (.*)
|
|
to /zh-cn/{1}
|
|
}
|
|
|
|
rewrite /zh-TW/ {
|
|
regexp (.*)
|
|
to /zh-tw/{1}
|
|
}
|
|
|
|
rewrite /pt-BR/ {
|
|
regexp (.*)
|
|
to /pt-br/{1}
|
|
}
|
|
|
|
rewrite /nl-NL/ {
|
|
regexp (.*)
|
|
to /nl-nl/{1}
|
|
}
|
|
|
|
rewrite /fr-FR/ {
|
|
regexp (.*)
|
|
to /fr-fr/{1}
|
|
}
|
|
|
|
header / Vary "Accept-Language"
|
|
}
|