diff options
author | Alex <alex@adnab.me> | 2022-02-07 11:51:12 +0100 |
---|---|---|
committer | Alex <alex@adnab.me> | 2022-02-07 11:51:12 +0100 |
commit | 1c0ba930b8d6aa5d97e6942852240861e6ab9bed (patch) | |
tree | cddc9af5fc2378c76fe5ef6306f807e27648b7a7 /doc/book/src/cookbook/exposing_websites.md | |
parent | 45d6d377d2011d8fb4ceb13bb4584df97c458525 (diff) | |
download | garage-1c0ba930b8d6aa5d97e6942852240861e6ab9bed.tar.gz garage-1c0ba930b8d6aa5d97e6942852240861e6ab9bed.zip |
Reorganize documentation for new website (#213)
This PR should be merged after the new website is deployed.
- [x] Rename files
- [x] Add front matter section to all `.md` files in the book (necessary for Zola)
- [x] Change all internal links to use Zola's linking system that checks broken links
- [x] Some updates to documentation contents and organization
Co-authored-by: Alex Auvolat <alex@adnab.me>
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/213
Co-authored-by: Alex <alex@adnab.me>
Co-committed-by: Alex <alex@adnab.me>
Diffstat (limited to 'doc/book/src/cookbook/exposing_websites.md')
-rw-r--r-- | doc/book/src/cookbook/exposing_websites.md | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/doc/book/src/cookbook/exposing_websites.md b/doc/book/src/cookbook/exposing_websites.md deleted file mode 100644 index 0cbb1150..00000000 --- a/doc/book/src/cookbook/exposing_websites.md +++ /dev/null @@ -1,48 +0,0 @@ -# Exposing buckets as websites - -You can expose your bucket as a website with this simple command: - -```bash -garage bucket website --allow my-website -``` - -Now it will be **publicly** exposed on the web endpoint (by default listening on port 3902). - -Our website serving logic is as follow: - - Supports only static websites (no support for PHP or other languages) - - Does not support directory listing - - The index is defined in your `garage.toml`. ([ref](/reference_manual/configuration.html#index)) - -Now we need to infer the URL of your website through your bucket name. -Let assume: - - we set `root_domain = ".web.example.com"` in `garage.toml` ([ref](/reference_manual/configuration.html#root_domain)) - - our bucket name is `garagehq.deuxfleurs.fr`. - -Our bucket will be served if the Host field matches one of these 2 values (the port is ignored): - - - `garagehq.deuxfleurs.fr.web.example.com`: you can dedicate a subdomain to your users (here `web.example.com`). - - - `garagehq.deuxfleurs.fr`: your users can bring their own domain name, they just need to point them to your Garage cluster. - -You can try this logic locally, without configuring any DNS, thanks to `curl`: - -```bash -# prepare your test -echo hello world > /tmp/index.html -mc cp /tmp/index.html garage/garagehq.deuxfleurs.fr - -curl -H 'Host: garagehq.deuxfleurs.fr' http://localhost:3902 -# should print "hello world" - -curl -H 'Host: garagehq.deuxfleurs.fr.web.example.com' http://localhost:3902 -# should also print "hello world" -``` - -Now that you understand how website logic works on Garage, you can: - - - make the website endpoint listens on port 80 (instead of 3902) - - use iptables to redirect the port 80 to the port 3902: - `iptables -t nat -A PREROUTING -p tcp -dport 80 -j REDIRECT -to-port 3902` - - or configure a [reverse proxy](reverse_proxy.html) in front of Garage to add TLS (HTTPS), CORS support, etc. - -You can also take a look at [Website Integration](/connect/websites.html) to see how you can add Garage to your workflow. |