Skip to content

Instantly share code, notes, and snippets.

@VirtuBox
Created July 19, 2017 16:54
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save VirtuBox/cff3d2e3153b3770e892592d1c888adc to your computer and use it in GitHub Desktop.
Save VirtuBox/cff3d2e3153b3770e892592d1c888adc to your computer and use it in GitHub Desktop.
Collabora online for NextCloud with Docker and Nginx

launch your container

docker run -t -d -p 127.0.0.1:9980:9980 -e "domain=yourdomain\\.tld" \
        -e "username=admin" -e "password=admin" --restart always --cap-add MKNOD collabora/code

nginx configuration

		
		# static files
	location ^~ /loleaflet {
		proxy_pass https://localhost:9980;
		proxy_set_header Host $http_host;
	}

	# WOPI discovery URL
	location ^~ /hosting/discovery {
		proxy_pass https://localhost:9980;
		proxy_set_header Host $http_host;
	}

	# main websocket
	location ~ ^/lool/(.*)/ws$ {
		proxy_pass https://localhost:9980;
		proxy_set_header Upgrade $http_upgrade;
		proxy_set_header Connection "Upgrade";
		proxy_set_header Host $http_host;
		proxy_read_timeout 36000s;
	}

	# download, presentation and image upload
	location ~ ^/lool {
		proxy_pass https://localhost:9980;
		proxy_set_header Host $http_host;
	}

	# Admin Console websocket
	location ^~ /lool/adminws {
		proxy_pass https://localhost:9980;
		proxy_set_header Upgrade $http_upgrade;
		proxy_set_header Connection "Upgrade";
		proxy_set_header Host $http_host;
		proxy_read_timeout 36000s;
	}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment