I’m using docker image collabora/code
behind nginx
docker image. But I when I try to add the collabora domain on my nextcloud instance, I’m getting 502 bad gateway errors.
My docker compose file:
version: '3'
services:
nginx:
image: nginx:latest
container_name: nginx_reverse_proxy
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
- /etc/letsencrypt/:/etc/letsencrypt/
- ./access_log:/var/log/nginx/hts-il-db-lb-access.log
- ./error_log:/var/log/nginx/hts-il-db-lb-error.log
ports:
- 80:80
- 443:443
collabora:
image: collabora/code
container_name: collabora
ports:
- 9980:9980
environment:
- domain=mydomain1.com|mydomain2.com
restart: always
networks:
default:
external: true
name: nginx-network
And my nginx.conf
file (copied from here):
events {}
http {
server {
server_name collabora.mydomain1.com;
listen 443 ssl;
ssl_certificate /etc/letsencrypt/live/collabora.mydomain1.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/collabora.mydomain1.com/privkey.pem;
# static files
location ^~ /loleaflet {
proxy_pass http://localhost:9980;
proxy_set_header Host $http_host;
}
# WOPI discovery URL
location ^~ /hosting/discovery {
proxy_pass http://localhost:9980;
proxy_set_header Host $http_host;
}
# Capabilities
location ^~ /hosting/capabilities {
proxy_pass http://localhost:9980;
proxy_set_header Host $http_host;
}
# main websocket
location ~ ^/lool/(.*)/ws$ {
proxy_pass http://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 http://localhost:9980;
proxy_set_header Host $http_host;
}
# Admin Console websocket
location ^~ /lool/adminws {
proxy_pass http://localhost:9980;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $http_host;
proxy_read_timeout 36000s;
}
error_log /var/log/nginx/hts-il-db-lb-error.log debug;
}
}
when i try to access collabora.mydomain1.com/hosting/discovery
I get 502 Bad gateway
in my browser, and on my collabora server instance, the terminal outputs: "GET /hosting/discovery HTTP/1.1" 502 157 "-" "Nextcloud Server Crawler"
Any suggestions? Thanks!