convos-chat / convos-chat/convos
Convos does not work properly behind reverse proxy with path
- Dominant language
- Go
- Stars
- 1.2k
- Forks
- 93
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
When convos is behind a reverse proxy with a path such as https://dnsname.com/convos, Convos does not work properly.
After investigating, several URL used in the web interface does not have the path. For instance:
convos request https://dnsname.com/api , where it should be https://dnsname.com/convos/api, I guess
**To Reproduce**
1. Setup apache with:
# Enable Convos to construct correct URLs by passing on custom headers.
ProxyRequests Off
ProxyPreserveHost On
RequestHeader set X-Request-Base "https://dnsname.com/convos"
# https://httpd.apache.org/docs/current/mod/mod_remoteip.html
RemoteIPHeader X-Forwarded-For
# http://httpd.apache.org/docs/2.0/mod/core.html#limitrequestbody
LimitRequestBody 0
# Pass requests on to Convos
ProxyPass /convos/events ws://localhost:3001/events
ProxyPass /convos/ http://localhost:3001/ keepalive=On
ProxyPassReverse /convos/ http://localhost:3001/convos/
2. start convos with:
`CONVOS_REQUEST_BASE="https://dnsname.com/convos/" CONVOS_REVERSE_PROXY=1 ./script/convos daemon --listen http://127.0.0.1:3001`
3. Open https://dnsname.com/convos
Convos show the login dialog but is partially loaded and does not work properly. Several HTTP resources aren't loaded and several HTTP request fail.
**Expected behavior**
Convos load all resource properly and can be used under a given http path
**Environment:**
- OS: Linux/Debian on aarch64
- Browser firefox on Linux/amd64
- Version 140.10.1esr
- IRC none (cannot login)
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the Apache reverse-proxy setup with the /convos path, CONVOS_REQUEST_BASE, and CONVOS_REVERSE_PROXY enabled. Inspect the generated resource and API URLs in the browser, then trace where those URLs are assembled. Done means all resources and HTTP requests retain the /convos prefix and the login flow is usable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- apache, linux
- Domain
- api, backend, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100