meta data for this page
  •  

This is an old revision of the document!


OnlyOffice

OnlyOffice and NextCloud in Docker. Both proxied by NGINX rev proxy.

NGINX config

Additional config lines for NextCloud virtual site config:

upstream docservice {
    server 192.168.64.231:3077;
}
 
map $http_x_forwarded_proto $the_scheme {
     default $http_x_forwarded_proto;
     "" $scheme;
}
 
map $http_x_forwarded_host $the_host {
    default $http_x_forwarded_host;
    "" $host;
}
 
map $http_upgrade $proxy_connection {
    default upgrade;
    "" close;
}
 
server { 
    ..
    location /documentserver {
        return 302 /documentserver/;
    }
    location ~ ^/web-apps/(.*) {
         # rewrite     ^   https://$server_name$request_uri? permanent;
         return 302 /documentserver/web-apps/$1$is_args$args;
    }
    location /documentserver/ {
        proxy_pass http://docservice/;
        proxy_http_version 1.1;
 
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $proxy_connection;
        proxy_set_header X-Forwarded-Host $the_host/documentserver;
        proxy_set_header X-Forwarded-Proto $the_scheme;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}

OnlyOffice network in Docker is configured:

  • as 'onlyoffice' node on port 80 (internal linked services network)
  • as TCP:3077 on Docker host (rev proxied by NGINX )