Troubleshooting Forgejo "Internal Server Error" on Coolify
Date: 22 July 2026
Platform: Coolify
Application: Forgejo
Database: MariaDB
🔴 Symptom
After deploying Forgejo on Coolify, accessing the Web UI results in a 500 Internal Server Error.
🔍 Log Analysis
Reviewing the container logs revealed the following patterns:
- MariaDB: Initialized successfully and ready for connections on port
3306. - Forgejo Web: Successfully started the web server on internal port
3000(Listen: http://0.0.0.0:3000). - Forgejo SSH: Successfully started the internal SSH server on port
22. - Error Signatures: The Forgejo logs repeatedly showed the following error when attempting to load the web page:
banner exchange: Connection from 10.0.11.4 port 44134: invalid format
🧠 Root Cause
Coolify's internal reverse proxy was mistakenly directing incoming web traffic (from the domain https://trowel.obulou.org) to Forgejo's SSH port (22) instead of its web server port (3000). Because the SSH server cannot process HTTP web requests, it rejects the connection, prompting the reverse proxy to return an "Internal Server Error" to the browser.
✅ Resolution
The port routing mapping in Coolify needs to be explicitly defined.
- Open the Coolify dashboard and navigate to the Forgejo resource/project.
- Go to the General or Configuration tab.
- Locate the Domains field.
- Append the internal web port to the domain URL to instruct the reverse proxy where to route the traffic.
- Change:
https://trowel.obulou.org - To:
https://trowel.obulou.org:3000 - (Note: This only affects internal routing; the public site remains accessible via standard HTTPS without typing the port).
- Change:
- Check the Ports Exposes field. Ensure that
3000is present. If multiple ports are listed, ensure3000is the primary/first port listed, as Coolify's proxy defaults to the first exposed port if it is not explicitly declared in the Domains field. - Save and Deploy/Restart the container.
🏷️ Tags
#coolify #forgejo #troubleshooting #500-error #reverse-proxy #port-mapping #devops
No comments to display
No comments to display