# Collabora Code with Nginx reverse proxy setup Bad Gateway error

**URL:** <https://forum.pydio.com/t/collabora-code-with-nginx-reverse-proxy-setup-bad-gateway-error/4206>\
**Category:** Pydio Cells\
**Tags:** plugins, docker\
**Created:** [December 14, 2021, 6:23pm UTC](https://forum.pydio.com/t/collabora-code-with-nginx-reverse-proxy-setup-bad-gateway-error/4206 "2021-12-14T18:23:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anthony\_Addotta](https://yyz2.discourse-cdn.com/flex032/user_avatar/forum.pydio.com/anthony_addotta/32/1585_2.png) [@Anthony\_Addotta](https://forum.pydio.com/u/Anthony_Addotta)\
**Post date:** [December 14, 2021, 6:23pm UTC](https://forum.pydio.com/t/collabora-code-with-nginx-reverse-proxy-setup-bad-gateway-error/4206/1 "2021-12-14T18:23:17Z")

</div>

Issue when trying to use Collabora in Pydio  
Getting bad gateway when trying to open documents

Pydio plugin is configured to  
Libre office ssl : off  
Host 192.168.0.22  
port is 9980

Servers  
Pydioserver 192.168.0.21  
Nginx reverse proxy server 192.168.0.22  
Collabora code (docker image) 192.168.0.22 listening on port 9980

Reverse proxy server and Collabora code docker image are running on the same server.

Everything else seems to work fine, Just cannot get this part working internally or externally.  
Any ideas would be greatly appreciated. TIA

> > > > > Nginx: Site\_enabled pydio config\>\>\>\>\>\>

```auto
upstream pydiolinux {
    server 192.168.0.21:8080;
    server 192.168.0.21:443;

}

upstream websocket{
        server 192.168.0.21:8080;
        server 192.168.0.21:443;

}

server {

    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/share.company.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/share.company.com/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

    server_name share.company.com; #(external url)

   client_max_body_size 10G;
        location / {
         if ($http_content_type = "application/grpc") {
            grpc_pass grpcs://192.168.0.21:8080;
        }
		 proxy_pass https://192.168.0.21:8080;
                      proxy_pass_request_headers on;
           proxy_set_header Host $host;
           proxy_set_header X-real-IP $remote_addr;
           grpc_pass grpcs://192.168.0.21:8080;
           proxy_buffering off;
           proxy_http_version 1.1;

     }

       location /chat/ {
         proxy_pass http://192.168.0.21:8080;
         proxy_http_version 1.1;
         proxy_set_header Upgrade $http_upgrade;
         proxy_set_header Connection 'upgrade';
    }

        location /ws/ {
#proxy_buffering off;
        proxy_pass https://192.168.0.21:8080;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
        proxy_read_timeout 86400s;
        proxy_send_timeout 86400;
     }

        location /minio/ {
        proxy_pass http://192.168.0.21:9003/;
}

}

    error_log /var/log/nginx/cells-proxy-error.log;
    access_log /var/log/nginx/cells-proxy-access.log;

server {
    if ($host = share.company.com) {
        return 301 https://$host$request_uri;
    } # managed by Certbot
listen 443 ssl http2;

        listen 80;
        listen [::]:80;
		
    # static files
       location ^~ /loleaflet {
               proxy_pass https://192.168.0.22:9980;
        proxy_set_header Host $http_host;
        proxy_set_header Host $host;
    }

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

    # Capabilities
      location ^~ /hosting/capabilities {
      proxy_pass https://192.168.0.22:9980;
      proxy_set_header Host $http_host;
      proxy_set_header Host $host;

    }

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

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

    # Admin Console websocket
       location ^~ ^/lool/adminws {
       proxy_pass https://192.168.0.22:9980;
	   proxy_set_header Upgrade $http_upgrade;
       proxy_set_header Connection "Upgrade";
       proxy_set_header Host $http_host;
       proxy_set_header Host $host;
       proxy_read_timeout 36000s;
    }

    # server_name share.company.com;
    return 404; # managed by Certbot

}
}

```

---

<div class="post-metadata">

**Author:** ![zayn](https://avatars.discourse-cdn.com/v4/letter/z/a87d85/32.png) [@zayn](https://forum.pydio.com/u/zayn)\
**Post date:** [December 24, 2021, 2:42pm UTC](https://forum.pydio.com/t/collabora-code-with-nginx-reverse-proxy-setup-bad-gateway-error/4206/2 "2021-12-24T14:42:08Z")

</div>

Hello @Anthony_Addotta,

Could you tell me if you run collabora with docker or not, and if it is with docker, which command did you start the container with ?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex032/uploads/pydio/original/2X/6/61f19fa52ec15fd4250db51aea351adba0e831fd.png) [@system](https://forum.pydio.com/u/system)\
**Post date:** [February 22, 2022, 2:42pm UTC](https://forum.pydio.com/t/collabora-code-with-nginx-reverse-proxy-setup-bad-gateway-error/4206/3 "2022-02-22T14:42:11Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
