aboutsummaryrefslogtreecommitdiff
path: root/sys/etc/caddy/Caddyfile
blob: 8c643a3dea17f9db3bdcb8f51df25e6b743794ac (plain) (blame)
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
{
	order cgi before respond
}

himbeerserver.de {
	reverse_proxy /_matrix/* localhost:8008

	root * /srv/www/static

	file_server
	templates

	redir / /md/index.md permanent

	@base {
		path /base/*

		not path /base/*.css
		not path /base/*.png
	}

	@markdown {
		path_regexp /md/.*\.md$
	}

	@well_known {
		path /favicon.ico
	}

	handle @markdown {
		rewrite * /base/render.html
	}

	handle @well_known {
		file_server
	}

	handle @base {
		error 403
	}

	handle_errors {
		file_server
		templates

		handle {
			rewrite * /base/error.html
		}
	}
}

www.himbeerserver.de {
	redir {scheme}://himbeerserver.de{uri} permanent
}

git.himbeerserver.de {
	root * /srv/www/static

	@base {
		path /base/*

		not path /base/*.css
		not path /base/*.png
	}

	@well_known {
		path /favicon.ico
	}

	handle @well_known {
		file_server
	}

	handle @base {
		error 403
	}

	handle_path /base/* {
		root * /srv/www/static/base
		file_server
	}

	handle_path /cgit/* {
		root * /usr/share/webapps/cgit
		file_server
	}

	handle {
		cgi * /usr/share/webapps/cgit/cgit.cgi
	}

	handle_errors {
		file_server
		templates

		handle {
			rewrite * /base/error.html
		}
	}
}

searxng.himbeerserver.de {
	reverse_proxy /searxng unix:///usr/local/searxng/run/socket

	transport uwsgi {
		uwsgi_param HTTP_HOST {host}
		uwsgi_param HTTP_CONNECTION {http.request.header.connection}

		uwsgi_param HTTP_X_SCHEME {http.request.scheme}
		uwsgi_param HTTP_X_SCRIPT_NAME /searxng

		uwsgi_param HTTP_X_REAL_IP {client_ip}
		uwsgi_param HTTP_X_FORWARDED_FOR {remote}
	}
}