# Nginx代理cool.html时报502，但访问hosting/discovery是可以的

**URL:** <https://forum.collaboraonline.com/t/nginx-cool-html-502-hosting-discovery/4080>\
**Category:** Installation & Configuration\
**Created:** [October 21, 2025, 5:17am UTC](https://forum.collaboraonline.com/t/nginx-cool-html-502-hosting-discovery/4080 "2025-10-21T05:17:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![zzyo](https://avatars.discourse-cdn.com/v4/letter/z/e495f1/32.png) [@zzyo](https://forum.collaboraonline.com/u/zzyo)\
**Post date:** [October 21, 2025, 5:17am UTC](https://forum.collaboraonline.com/t/nginx-cool-html-502-hosting-discovery/4080/1 "2025-10-21T05:17:06Z")

</div>

nginx代理cool.html时报502，但访问hosting/discovery是可以的，什么原因

---

<div class="post-metadata">

**Author:** ![darshan](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.collaboraonline.com/darshan/32/2230_2.png) [@darshan](https://forum.collaboraonline.com/u/darshan)\
**Post date:** [October 23, 2025, 6:53am UTC](https://forum.collaboraonline.com/t/nginx-cool-html-502-hosting-discovery/4080/2 "2025-10-23T06:53:28Z")

</div>

hii @zzyo

If **`/hosting/discovery` works** but **`/cool.html` gives 502** , it means your **basic HTTP proxy works** , but **WebSocket (or long connection)** traffic isn’t passing correctly through Nginx.  
`cool.html` needs WebSocket (`/cool/…/ws`) to talk to Collabora, while `/hosting/discovery` is just a simple HTTP request — that’s why discovery works but the editor page fails.

### enable WebSocket proxying

In your Nginx config, make sure you have something like this:

```nginx
location ^~ /cool/ {
    proxy_pass https://127.0.0.1:9980;
    proxy_set_header Host $host;

    # Required for WebSocket support
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";

    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;

    proxy_read_timeout 36000s;
    proxy_ssl_verify off;
}

```

Replace `https://127.0.0.1:9980` with `http://127.0.0.1:9980` if your Collabora instance isn’t using SSL internally.

* * *

### Extra checks

1. **Collabora URL** — make sure the internal port (e.g. 9980) is reachable from Nginx.
2. **Self-signed certificate?** — if you’re using one, `proxy_ssl_verify off;` is needed.
3. **Trailing slash consistency** — ensure you access `/cool/` not `/cool` in the proxy path.

I also see many past thread in forum with same issue so i would suggest to explore using search ? [Bad Gateway 502 with Nginx on native Install - Debian](http://forum.collaboraonline.com/t/bad-gateway-502-with-nginx-on-native-install-debian/3129)

---

<div class="post-metadata">

**Author:** ![zzyo](https://avatars.discourse-cdn.com/v4/letter/z/e495f1/32.png) [@zzyo](https://forum.collaboraonline.com/u/zzyo)\
**Post date:** [October 24, 2025, 6:34am UTC](https://forum.collaboraonline.com/t/nginx-cool-html-502-hosting-discovery/4080/3 "2025-10-24T06:34:12Z")

</div>

我加上了 也不行，貌似就静态资源有问题，里面的接口都是能调用的
