Skip to content

Commit

Permalink
Merge pull request #437 from nextcloud/enh/315/add-nginx
Browse files Browse the repository at this point in the history
improve reverse proxy conf - add nginx
  • Loading branch information
szaimen authored Mar 31, 2022
2 parents e22c6d6 + ae36403 commit e672a50
Showing 1 changed file with 38 additions and 2 deletions.
40 changes: 38 additions & 2 deletions reverse-proxy.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
## Reverse Proxy Config
## Reverse Proxy Documentation

Basically, you need to specify the port that the apache container shall use and modify the startup command a bit.

All examples below will use port `11000` as example apache port. Also it is supposed that the reverse proxy runs on the same server like AIO, hence `localhost` is used and not an internal ip-address to point to the AIO instance. Modify both to your needings.

### Caddy reverse proxy config example
### Reverse proxy config examples

#### Caddy

<details>

<summary>click here to expand</summary>
<br>
Add this to your Caddyfile:

```
Expand All @@ -17,8 +23,38 @@ https://<your-nc-domain>:443 {

Of course you need to modify `<your-nc-domain>` to the domain on which you want to run Nextcloud.

</details>

#### Nginx

<details>

<summary>click here to expand</summary>
<br>
Add this to you nginx config:

```
location / {
proxy_pass http://localhost:11000;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# Websocket
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}
```

Of course SSL needs to be set up as well e.g. by using certbot and your domain must be also added inside the nginx config.

</details>

### Startup command

After adjusting your reverse proxy config, use the following command to start AIO:

```
# For x64 CPUs:
sudo docker run -it \
Expand Down

0 comments on commit e672a50

Please sign in to comment.