-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added new website host --------- Co-authored-by: Nicolas Berens <[email protected]>
- Loading branch information
1 parent
75f722f
commit 11abf03
Showing
6 changed files
with
505 additions
and
379 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--- | ||
caddy_caddyfile: Caddyfile_website.j2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,3 +55,9 @@ | |
- tunneldigger | ||
tags: | ||
- tunneldigger | ||
|
||
- name: Set up website | ||
hosts: website | ||
become: true | ||
roles: | ||
- caddy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
# www redirect | ||
www.berlin.freifunk.net { | ||
redir https://berlin.freifunk.net{uri} | ||
} | ||
|
||
# production | ||
berlin.freifunk.net { | ||
root * /srv/www/berlin.freifunk.net | ||
encode gzip | ||
|
||
@de_before_en { | ||
header_regexp Accept-Language de.*en | ||
path / | ||
} | ||
@en_before_de { | ||
header_regexp Accept-Language en.*de | ||
path / | ||
} | ||
@de_only { | ||
header_regexp Accept-Language de | ||
path / | ||
} | ||
@fallback { | ||
path / | ||
} | ||
|
||
redir @de_before_en /de 302 | ||
redir @en_before_de /en 302 | ||
redir @de_only /de 302 | ||
redir @fallback /en 302 | ||
|
||
redir /index_en /en 301 | ||
redir /network /de/map 301 | ||
redir /contact /de/contact/ 301 | ||
redir /contact_en /en/contact 301 | ||
redir /download /de/downloads 301 | ||
redir /participate/ /de/participate 301 | ||
redir /p /de/participate 301 | ||
redir /impressum /de/impressum 301 | ||
redir /wiki /de/wiki 301 | ||
redir /meshwiki /de/wiki 301 | ||
|
||
file_server | ||
} | ||
|
||
# development | ||
dev.berlin.freifunk.net { | ||
root * /srv/www/dev.berlin.freifunk.net | ||
encode gzip | ||
|
||
@de_before_en { | ||
header_regexp Accept-Language de.*en | ||
path_regexp branch ^\/([[:alnum:]]+)(\/$|$) | ||
} | ||
@en_before_de { | ||
header_regexp Accept-Language en.*de | ||
path_regexp branch ^\/([[:alnum:]]+)(\/$|$) | ||
} | ||
@de_only { | ||
header_regexp Accept-Language de | ||
path_regexp branch ^\/([[:alnum:]]+)(\/$|$) | ||
} | ||
@fallback { | ||
path_regexp branch ^\/([[:alnum:]]+)(\/$|$) | ||
} | ||
|
||
redir @de_before_en /{re.branch.1}/de 302 | ||
redir @en_before_de /{re.branch.1}/en 302 | ||
redir @de_only /{re.branch.1}/de 302 | ||
redir @fallback /{re.branch.1}/en 302 | ||
|
||
@index_en { | ||
path_regexp branch ^\/([[:alnum:]]+)\/index\_en | ||
} | ||
redir @index_en /{re.branch.1}/en 301 | ||
|
||
@network { | ||
path_regexp branch ^\/([[:alnum:]]+)\/network | ||
} | ||
redir @network /{re.branch.1}/de/map 301 | ||
|
||
@contact { | ||
path_regexp branch ^\/([[:alnum:]]+)\/contact | ||
} | ||
redir @contact /{re.branch.1}/de/contact 301 | ||
|
||
@contact_en { | ||
path_regexp branch ^\/([[:alnum:]]+)\/contact_en | ||
} | ||
redir @contact_en /{re.branch.1}/en/contact 301 | ||
|
||
@download { | ||
path_regexp branch ^\/([[:alnum:]]+)\/download | ||
} | ||
redir @download /{re.branch.1}/de/downloads 301 | ||
|
||
@participate { | ||
path_regexp branch ^\/([[:alnum:]]+)\/(participate|p$) | ||
} | ||
redir @participate /{re.branch.1}/de/participate 301 | ||
|
||
@impressum { | ||
path_regexp branch ^\/([[:alnum:]]+)\/impressum | ||
} | ||
redir @impressum /{re.branch.1}/de/impressum 301 | ||
|
||
@wiki { | ||
path_regexp branch ^\/([[:alnum:]]+)\/(meshwiki|wiki) | ||
} | ||
redir @wiki /{re.branch.1}/de/wiki 301 | ||
|
||
file_server | ||
} |