~comcloudway/pages

666ddc7530d14028c4b173e0d61231c092f435df — Jakob Meier 8 months ago d3cb10c feb-2024
Added caddy proxy config
1 files changed, 24 insertions(+), 0 deletions(-)

M README.md
M README.md => README.md +24 -0
@@ 22,4 22,28 @@ you can use `serve build`
## Hosting
I'm currently serving the files directly from an `s3`-bucket using caddy.

```Caddyfile
ccw.icu {
	# match .html files and folders (because they'll be redirected to index.html
	@html {
		path_regexp (\.html|^(.*)/)$
	}
	# match .css files
	@css {
		path_regexp \.css$
	}
	# auto index.html redirect
	uri * path_regexp ^(.*)/$ $1/index.html
	header @html -Content-Type text/html
	# set default content type for css
	header @css ?Content-Type text/css
	# unset content type for .css files
	header @css -Content-Type
	# internally rewrite url to suite s3 bucket
	# "website" - bucket name
	rewrite * /website/{path}
	reverse_proxy :9000
}
```

[![builds.sr.ht status](https://builds.hut.ccw.icu/~comcloudway/pages.svg)](https://builds.hut.ccw.icu/~comcloudway/pages?)