I am trying to set up a Unity game server alongside an Nginx reverse proxy within the same Docker container. Internally, everything seems to work fine—Nginx is forwarding requests to the Unity game server, and both components are active. However, when I try to connect externally (e.g., using Postman or a WebGL client), the connection fails or hangs indefinitely.
Here’s my setup:
- Unity Game Server: Configured with
SimpleWebTransport
on port 7777. - Nginx: Configured to listen on port 80 and forward WebSocket connections to the game server.
- PlayFab Local Multiplayer Agent: Used for testing the game server locally with port mappings in the configuration.
Attempts:
- Verified ports are open (
ss -tuln
shows listening). - Checked Nginx logs—connections are logged but fail to reach the Unity server externally.
- Updated file permissions and ensured logs are writable.
- Tested WebSocket connections directly to the Unity server (works internally but not externally).
- Followed Unity’s
SimpleWebTransport
documentation and updated code to ensure compatibility.
Still, external connections via Nginx are not functioning as expected. Has anyone successfully deployed a similar setup or encountered this issue? Any insights or solutions would be greatly appreciated!