Merge pull request #437 from nextcloud/enh/315/add-nginx

improve reverse proxy conf - add nginx
This commit is contained in:
Simon L 2022-03-31 15:48:58 +02:00 committed by GitHub
commit e672a5029b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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:
```
@ -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 \