-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add reverse proxy config documentation (#267)
Hey, since I've been using Actual via Traefik for a few days now, I took the time to add a little bit to the documentation in that regard. I hope it fits so far. Please feel free to comment/improve anything.
- Loading branch information
Showing
6 changed files
with
125 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,3 +20,4 @@ SVGR | |
swc | ||
ubuntu | ||
VRT | ||
websecure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
--- | ||
title: Using a Reverse Proxy | ||
--- | ||
|
||
# Using a Reverse Proxy | ||
|
||
If you want to expose Actual to the internet, you should hide it behind a reverse proxy with SSL enabled. | ||
There are a series of tools that can be used for this purpose. This configuration page is dynamic, so that new tools and their configuration can be added continuously. | ||
|
||
In our examples, the Actual Server should be published under the domain **budget.example.org**. | ||
|
||
:::note | ||
The **basic configurations** provided here are only suggestions for implementing a reverse proxy configuration. Additional security mechanisms should then be activated/implemented for the tool selected in each case. | ||
::: | ||
|
||
## Traefik | ||
|
||
Our example shows a working configuration for Traefik and Actual Server using Docker - as documented in [Install Actual/Docker](../install/docker.md) | ||
|
||
```yaml title="docker-compose.yml" | ||
services: | ||
traefik: | ||
image: traefik:latest | ||
restart: unless-stopped | ||
ports: | ||
- "80:80" | ||
- "443:443" | ||
volumes: | ||
- "./traefik.yaml:/etc/traefik/traefik.yaml" | ||
- "./traefik/data:/data" | ||
- "/var/run/docker.sock:/var/run/docker.sock" | ||
|
||
actual-server: | ||
image: actualbudget/actual-server:latest | ||
restart: unless-stopped | ||
labels: | ||
- "traefik.enable=true" | ||
- "traefik.http.routers.actual-server.rule=Host(`budget.example.org`)" | ||
- "traefik.http.routers.actual-server.entrypoints=websecure" | ||
volumes: | ||
- ./actual-data:/data | ||
restart: unless-stopped | ||
``` | ||
```yaml title="traefik.yaml" | ||
entryPoints: | ||
web: | ||
address: ":80" | ||
http: | ||
redirections: | ||
entryPoint: | ||
to: websecure | ||
scheme: https | ||
permanent: true | ||
websecure: | ||
address: ":443" | ||
http: | ||
tls: | ||
certResolver: le | ||
|
||
providers: | ||
docker: {} | ||
|
||
certificatesResolvers: | ||
letsencrypt: | ||
acme: | ||
email: [email protected] | ||
storage: /data/letsencrypt.json | ||
httpChallenge: | ||
entryPoint: web | ||
``` | ||
Please refer to the [official documentation](https://doc.traefik.io/traefik/user-guides/docker-compose/basic-example/) for further details. | ||
## NGINX | ||
```nginx title="NGINX Example Config" | ||
server { | ||
listen 443 ssl; | ||
listen [::]:443 ssl; | ||
server_name budget.*; | ||
|
||
include /config/nginx/ssl.conf; | ||
client_max_body_size 0; | ||
|
||
# With SSL via Let's Encrypt | ||
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; # managed by Certbot | ||
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; # managed by Certbot | ||
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot | ||
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot | ||
|
||
location / { | ||
include /config/nginx/proxy.conf; | ||
include /config/nginx/resolver.conf; | ||
|
||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header Host $host; | ||
|
||
set $upstream_app actual-server; | ||
set $upstream_port 5006; | ||
set $upstream_proto http; | ||
proxy_pass $upstream_proto://$upstream_app:$upstream_port; | ||
} | ||
} | ||
``` | ||
|
||
The SSL certificate is issued by Let's Encrypt. The [Certbot](https://certbot.eff.org/instructions) tool provides options for automatic updating upon expiration. | ||
At the very least you will need to adapt `server_name` and the `ssl_certificate/ssl_certificate_key` paths to match your setup. | ||
Please refer to their [official documentation](https://nginx.org/en/docs/) for further details. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters