ONLYOFFICE documentserver (502 / dropped connection)
adityaohri
HOBBYOP

22 days ago

Title: ONLYOFFICE documentserver — healthy container, but public domain AND TCP proxy both fail to respond (502 / dropped connection)

Body:

I'm deploying the official onlyoffice/documentserver Docker image on the Hobby plan and cannot reach it externally, despite the container appearing fully healthy.

Setup:

Service deployed from Docker image onlyoffice/documentserver (latest)

Plan: Hobby

Region: US West

Variables set: JWT_ENABLED=true, JWT_SECRET=, PORT=80

Public domain target port: 80

Serverless: disabled. Healthcheck path: not set.

What works:

The container boots cleanly every deploy. Deploy logs reach Done and Generating js caches, please wait...Done, and the service shows Online with a single stable replica (no crash-loop — same replica ID stays alive for minutes after boot). Metrics show calm CPU and ~1GB memory, well under limits.

What fails:

The public domain (...up.railway.app/healthcheck) returns 502 "Application failed to respond."

I also added a TCP Proxy on port 80, and that also fails (thomas.proxy.rlwy.net:35732/healthcheck → "server unexpectedly dropped the connection").

Since both the HTTP edge proxy and the raw TCP proxy can't reach it, I suspect the container's nginx isn't binding to 0.0.0.0:80 (i.e. it's reachable internally but not on the external interface Railway forwards to), rather than a target-port mismatch.

Possible clue: On every boot the logs show:

  • Starting nginx nginx

    ...fail!

This image runs fine on a standard VM, so I think something in the Railway environment is affecting how its bundled nginx binds. Could you check server-side what interface/port the container is actually listening on, and advise what's needed to make this image's nginx bind correctly for Railway's proxy?

Deployment ID: 62f5080a-7617-445e-a38b-05063c38c94d

Service ID: 564be32f-c054-4941-8002-dafea8a2d940

$10 Bounty

2 Replies

Railway
BOT

22 days ago

This thread has been opened as a bounty so the community can help solve it.

Status changed to Open Railway 22 days ago


brayangp
PRO

21 days ago

The issue is that Railway runs containers without root privileges, so nginx can't bind to port 80. Set PORT=8080, update the public domain target port to 8080, and add ONLYOFFICE_HTTP_PORT=8080 as an env variable. If that doesn't work, a custom nginx.conf listening on 0.0.0.0:8080 is needed.


If it's a root privilege issue, try to set RAILWAY_RUN_UID=0 in your service variables. This will give you root privileges.


Welcome!

Sign in to your Railway account to join the conversation.

Loading...