Skip to content

Commit

Permalink
Add Caddy support
Browse files Browse the repository at this point in the history
  • Loading branch information
yamila-moreno committed Jun 2, 2021
1 parent 5fdade2 commit e11975d
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 2 deletions.
45 changes: 45 additions & 0 deletions Caddyfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
local.taiga.io {

# backend admin and api
@taiga-back path /admin* /api*
handle @taiga-back {
reverse_proxy 127.0.0.1:8001
}

# events
handle /events* {
reverse_proxy 127.0.0.1:8888
}

# static and frontend
handle {
root /static/* /home/taiga/taiga-back
root * /home/taiga/taiga-front-dist/dist

try_files {path} {path}/ /index.html
file_server
}

# unprotected section
handle /media/exports/* {
header Content-disposition "attachment"
root * /home/taiga/taiga-back
file_server
}

# protected section
handle_path /media/* {
reverse_proxy localhost:8003 {
@accel header X-Accel-Redirect *
handle_response @accel {
root * /home/taiga/taiga-back
header Content-Disposition "attachment"
rewrite {http.reverse_proxy.header.X-Accel-Redirect}
file_server
}
}
}

# TLS, log, etc
# Configure your TLS following the best practices inside your company
}
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ doc:
asciidoctor -T custom-html5 -o dist/integrations-gogs.html integrations-gogs.adoc
asciidoctor -T custom-html5 -o dist/integrations-slack.html integrations-slack.adoc
cp -r assets/* dist || exit 1
cp Caddyfile dist || exit 1
pdf:
asciidoctor -a allow-uri-read -r asciidoctor-pdf -b pdf -o dist/pdfs/index.pdf index.adoc
asciidoctor -a allow-uri-read -r asciidoctor-pdf -b pdf -o dist/pdfs/setup-production.pdf setup-production.adoc
Expand Down
25 changes: 23 additions & 2 deletions setup-production.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -733,8 +733,8 @@ cp ~/taiga-protected/env.sample ~/taiga-protected/.env

The `SECRET_KEY` value in `.env` must be the same as the `SECRET_KEY` in `~/taiga-back/settings/config.py`.

[[start-and-expose]]
=== Start and Expose Taiga
[[start-taiga]]
=== Start Taiga

Now it's time to create the different systemd services to serve different modules of Taiga.

Expand Down Expand Up @@ -883,6 +883,11 @@ sudo systemctl enable taiga-protected
sudo systemctl status taiga-protected
----

[[expose-taiga-nginx]]
=== Expose Taiga with NGINX

The recommended way to serve Taiga is to use NGINX proxy server.

[[nginx]]
.Remove the default NGINX config file to avoid collision with Taiga:
[source,bash]
Expand Down Expand Up @@ -1008,6 +1013,22 @@ sudo systemctl restart 'taiga*'

**Now you should have the service up and running on: `https://example.com/`**

[[expose-taiga-other]]
=== Other methods to expose Taiga

.Caddy server
It's possible to serve Taiga with Caddy as well, following the next guides:

- install caddy >= 2.4.1
- create a symlink from `media` to `_protected`
[source,bash]
----
cd ~/taiga-back
ln -s media/ _protected
----
- use a Caddyfile based on link:Caddyfile[this]


[[extend-taiga]]
=== Extend Taiga

Expand Down

0 comments on commit e11975d

Please sign in to comment.