-
-
Notifications
You must be signed in to change notification settings - Fork 72
Expand file tree
/
Copy pathCaddyfile
More file actions
68 lines (50 loc) · 1.88 KB
/
Caddyfile
File metadata and controls
68 lines (50 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
{
# Debug
{$CADDY_DEBUG}
}
{$SERVER_NAME}
log {
output file /var/log/caddy/access.log
}
@distribution path_regexp ^/docs/distribution(?:/?)$
redir @distribution /docs/symfony/
# note that once 4.1 is out we may need to improve this
@coreToSymfony path_regexp pathMatch ^/docs/core/(controllers|file-upload|fosuser-bundle|messenger|migrate-from-fosrestbundle|nelmio-api-doc|user)(?:/?)$
redir @coreToSymfony /docs/symfony/{re.pathMatch.1}/
@angular path_regexp pathMatch ^/docs/core/angularjs-integration(?:/?)$
redir @angular /docs/core/client-integration/
@docsroot path_regexp ^/docs(/?)$
redir @docsroot /docs/symfony/
@withoutTrailingSlash {
path_regexp ^/docs
not path_regexp .*/$
not path_regexp \.\w+$
}
redir @withoutTrailingSlash {path}/
@versionold path_regexp version ^/docs/v((?:2|3)\.\d)/?$
redir @versionold /docs/v{re.version.1}/distribution/
@version path_regexp version ^/docs/v([^/]+)/?$
redir @version /docs/v{re.version.1}/symfony/
@version_current path_regexp path ^/docs/v4\.3/(.*)
redir @version_current /docs/{re.path.1}
@withoutExtension not path_regexp \.\w+$
@withTld path_regexp \.(org|io|fr|com|pl|me|de|gg|dev)$
@withTrailingSlash path_regexp ^(.*)/+$
handle_path /docs/* {
# you could ADD ./docs /srv/app/docs and use this for development
# root * /srv/app/docs
# file_server
reverse_proxy {$BUCKET_S3_UPSTREAM} {
header_up Host {http.reverse_proxy.upstream.hostport}
}
# Handles DocumentIndices
rewrite @withTld /{$BUCKET_S3_NAME}{path}/index.html
rewrite @withTrailingSlash /{$BUCKET_S3_NAME}{path}index.html
rewrite @withoutExtension /{$BUCKET_S3_NAME}{path}/index.html
rewrite * /{$BUCKET_S3_NAME}{path}
}
handle {
# Disable Topics tracking if not enabled explicitly: https://github.com/jkarlin/topics
header ?Permissions-Policy "browsing-topics=()"
reverse_proxy http://{$PWA_UPSTREAM}
}