forked from flyspray/flyspray
-
Notifications
You must be signed in to change notification settings - Fork 0
/
caddy.dist
63 lines (48 loc) · 1.48 KB
/
caddy.dist
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
# work in progress for providing an example Caddyfile for caddy v2 web server
{
servers {
protocol {
experimental_http3
}
}
}
# or set port :8080
# or set domain with port together yourdomain:8080
yourdomain {
encode gzip zstd
root * /yourdomain/htdocs
php_fastcgi unix//run/php/php7.4-fpm.sock
file_server {
hide .git
}
@privatepaths {
path /.htaccess
path /includes/*
path /attachments/*
path_regexp /(plugins|themes|vendor)/.*\.(php|pl|py|cgi|tpl|twig|sh)$
}
respond @privatepaths 403
@cachehalfayear {
}
@cacheforaweek {
path *.woff
path *.css
path *.js
}
header @cachehalfayear Cache-Control "max-age=15778463"
header @cacheforaweek Cache-Control "max-age=604800"
# TODO: conversion from .htaccess Apache Rewrite rules (see htaccess.dist)
@taskrule1 path_regexp taskrule1 ^task/([0-9]+)$
rewrite @taskrule1 index.php?do=details&task_id={re.taskrule1.1}
# admin TODO
@adminrule1 path_regexp adminrule1 ^/admin/([a-zA-Z]+)$
rewrite @adminrule1 index.php?do=admin&area={re.adminrule1.1}
@adminrule2 path_regexp adminrule2 ^/admin/editgroup/([0-9]+)$
rewrite @adminrule2 index.php?do=admin&area=editgroup&id={re.adminrule2.1}
# project TODO
@pmrule1 path_regexp pmrule1 ^/pm/proj([0-9]+)/([a-zA-Z]+)$
rewrite @pmrule1 index.php?do=pm&project={re.pmrule1.1}&area={re.pmrule1.2}
@pmrule2 path_regexp pmrule2 ^/pm/editgroup/([0-9]+)$
rewrite @pmrule2 index.php?do=pm&area=editgroup&id={re.pmrule2.1}
# respond "Down due to migration..be back soon" 503
}