mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-01-14 17:37:40 +08:00
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:
parent
6b0b65e425
commit
b7708b66df
1 changed files with 26 additions and 33 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue