Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve reverse proxy conf - add nginx #437

Merged
merged 1 commit into from
Mar 31, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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