optimize nginx reverse proxy documentation

With this change, it is not needed to change the main http block

Signed-off-by: Zoey <zoey@z0ey.de>
This commit is contained in:
Zoey 2022-10-28 17:06:44 +02:00
parent 6b0b65e425
commit b7708b66df

View file

@ -236,6 +236,11 @@ Of course you need to modify `<your-nc-domain>` to the domain on which you want
Add this to you nginx config:
```
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 80;
# listen [::]:80; # uncomment to use IPv6
@ -276,18 +281,6 @@ server {
}
```
and this to the http{...}-section in your nginx.conf:
```
##
# Connection header for WebSocket reverse proxy
##
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
```
(otherwise nginx will fail to start with a message saying the variable named connection_upgrade does not exist)
Of course you need to modify `<your-nc-domain>` to the domain on which you want to run Nextcloud. Also make sure to adjust the port 11000 to match the chosen APACHE_PORT. **Please note:** The above configuration will only work if your reverse proxy is running directly on the host that is running the docker daemon. If the reverse proxy is running in a docker container, you can use the `--network host` option (or `network_mode: host` for docker-compose) when starting the reverse proxy container in order to connect the reverse proxy container to the host network. If that is not an option for you, you can alternatively instead of `localhost` use the ip-address that is displayed after running the following command on the host OS: `ip a | grep "scope global" | head -1 | awk '{print $2}' | sed 's|/.*||'` (the command only works on Linux)