Skip to content

Commit 7efb700

Browse files
feat(docs): apache reverse proxy readme (#92)
* Update README.md - Instruction for Apache reverse proxy and 3 hosts Update of the Readme related to this issue : #85 Signed-off-by: Manikou <91145906+manik0u@users.noreply.github.com> * docs(README): address review feedback for Apache reverse proxy section Signed-off-by: Oleksander Piskun <oleksandr2088@icloud.com> --------- Signed-off-by: Manikou <91145906+manik0u@users.noreply.github.com> Signed-off-by: Oleksander Piskun <oleksandr2088@icloud.com> Co-authored-by: Manikou <91145906+manik0u@users.noreply.github.com>
1 parent 47145b7 commit 7efb700

1 file changed

Lines changed: 79 additions & 0 deletions

File tree

README.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,34 @@ docker run \
7373

7474
> **Warning:** Do not forget to change the **HP_SHARED_KEY** value to a secure one!
7575
76+
#### Advanced Docker Deployment with Nextcloud and Docker Host behind Apache Reverse Proxy
77+
78+
##### On the Docker Host
79+
##### Creation of Cert folder (if necessary)
80+
`mkdir -p /some/path/certs`
81+
##### Open ports (based on Almalinux - RHEL Distros)
82+
```
83+
firewall-cmd --permanent --zone=public --add-port=8780/tcp
84+
firewall-cmd --permanent --zone=public --add-port=8782/tcp
85+
firewall-cmd --reload
86+
```
87+
##### Deploy of the HaRP Container
88+
```
89+
docker run \
90+
-e HP_SHARED_KEY="some_very_secure_password" \
91+
-e NC_INSTANCE_URL="https://cloud.acme.com" \
92+
-e HP_TRUSTED_PROXY_IPS="192.168.0.0/24" \
93+
-v /var/run/docker.sock:/var/run/docker.sock \
94+
-v /some/path/certs:/certs \
95+
-p 8780:8780 \
96+
-p 8782:8782 \
97+
--name appapi-harp -h appapi-harp \
98+
--restart unless-stopped \
99+
-d ghcr.io/nextcloud/nextcloud-appapi-harp:release
100+
```
101+
102+
> **Note:** You have to configure the **NC_INSTANCE_URL** value with your public Nextcloud url and the **HP_TRUSTED_PROXY_IPS** value with your local network (CDIR) that hosts your reverse proxy and your Nextcloud instance.
103+
76104
---
77105

78106
## Configuring Your Reverse Proxy
@@ -135,6 +163,18 @@ http:
135163

136164
> **Note:** The `1800s` (30 minutes) read timeout matches HaRP's default `HP_TIMEOUT_SERVER` value. This is required for slow-responding ExApps (e.g., `context_chat_backend`) that may take a long time to process requests like document indexing or AI responses.
137165

166+
### Apache Example
167+
#### On the Apache Reverse Proxy Host - Reverse proxy redirections
168+
On the virtual Host "cloud.acme.com" of the apache conf file
169+
Add the following lines (before the existing configuration)
170+
```apache
171+
# AppAPI Configuration
172+
ProxyPass /exapps/ http://<IP_host2_docker>:8780/exapps/
173+
ProxyPassReverse /exapps/ http://<IP_host2_docker>:8780/exapps/
174+
ProxyTimeout 1800
175+
```
176+
177+
138178
### Cloudflare Tunneling Example
139179
![cloudflare-tunnel-1](assets/cloudflare-tunnel-1.png)
140180

@@ -144,6 +184,45 @@ http:
144184

145185
---
146186

187+
## Nextcloud Configuration
188+
189+
Based on a infrastructure With 3 hosts :
190+
- Reverse Proxy
191+
- Nextcloud
192+
- Docker
193+
194+
### On the Nextcloud Web Interface - Daemon Register
195+
Add the following configuration :
196+
```
197+
Daemon Configuration template : HaRP Proxy (HOST)
198+
Surname : appapi-harp
199+
Display name : appapi-harp
200+
Deployment method : docker-install
201+
HaRP host : <IP_host2_docker>:8780
202+
HaRP shared key : some_very_secure_password
203+
Nextcloud URL : https://cloud.acme.com
204+
FRP server address : <IP_host2_docker>:8782
205+
Docker network : bridge
206+
```
207+
208+
Finally, test the whole setup with “Test deploy” in the 3-dots menu of the deploy daemon.
209+
210+
### Additional tests from the network of your hosts (based on Almalinux - RHEL Distros)
211+
```
212+
curl -fsS \
213+
-H "harp-shared-key: some_very_secure_password" \
214+
-H "docker-engine-port: 24000" \
215+
http://<IP_host2_docker>:8780/exapps/app_api/v1.41/_ping
216+
```
217+
218+
```
219+
curl -fsS \
220+
-H "harp-shared-key: some_very_secure_password" \
221+
-H "docker-engine-port: 24000" \
222+
https://cloud.acme.com/exapps/app_api/v1.41/_ping
223+
```
224+
225+
147226
## Environment Variables
148227
149228
HaRP is configured via several environment variables. Here are the key variables and their defaults:

0 commit comments

Comments
 (0)