mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-02-24 22:06:00 +08:00
Merge pull request #1336 from nextcloud/optimize-nginx
optimize nginx reverse proxy documentation
This commit is contained in:
commit
0397f30bb5
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:
|
Add this to you nginx config:
|
||||||
|
|
||||||
```
|
```
|
||||||
|
map $http_upgrade $connection_upgrade {
|
||||||
|
default upgrade;
|
||||||
|
'' close;
|
||||||
|
}
|
||||||
|
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
# listen [::]:80; # uncomment to use IPv6
|
# 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)
|
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