This is a repost of an issue (ReverseProxyPlug and longpoll · Issue #146 · tallarium/reverse_proxy_plug · GitHub) I opened . The forum is probably the better place, so I’ll link back in the issue at some point.
I am not 100% sure if this is an issue concerning Plug, Phoenix or the ReverseProxyPlug.
My setup: I want to proxy a CouchDB 3.2.1 in my Phoenix app, my initial attempt is using ReverseProxyPlug:
forward "/db", ReverseProxyPlug, upstream: Application.get_env(:my_app, :couchdb_root)
But clients that connect throw an error when listening to changes:
GET http://localhost:4000/db/project_1/_changes?timeout=600000&style=all_docs&feed=longpoll&heartbeat=10000&since=11-g1AAAACLe(...)AqSw&limit=50) net::ERR_INCOMPLETE_CHUNKED_ENCODING
All other communication between the CouchDB/PouchDB instances is working out fine, I suspect the error occurs because of the longpolling.
Any pointers in the right direction appreciated.