tentwentyfour / nextcloud-link

Javascript/Typescript client that communicates with Nextcloud's WebDAV and OCS APIs
MIT License
56 stars 7 forks source link

Unable to use with reverse proxy #25

Closed ghost closed 3 years ago

ghost commented 3 years ago

In my test environment I recently started using nginx as a reverse proxy. Since then, the connection has stopped working correctly. So I tried to get a workaround with global-tunnel-ng to run. Unfortunately without success. Could you implement a way that you can easily define a proxy?

Possibly something like: new NextcloudClient ({ username: 'username', password: 'password', url: 'https://example.com', proxy: 'https: //X.X.X.X:PORT' });

Best regards!

floriansimon1 commented 3 years ago

I could work on this. My only request is, can you provide a simple way to reproduce the issue please? Maybe a docker-compose file that starts containers and showcase the connection issue?

kwisatz commented 3 years ago

Hi @snake-stack, happy to help.

Before @floriansimon1 starts working on this, I'd like to check with you what exactly you're trying to achieve. We're running this ourselves with a reverse proxy between the client that uses nextcloud-link and the Nextcloud instances and no extra configuration is required here.

So I'm guessing you're actually talking about a web-proxy, especially since you're also supplying username and password? (To distinguish, a (web) proxy would sit at the client side, proxy-ing any outgoing traffic towards the Nextcloud instance, whereas the reverse proxy would be sitting in front of the server side, proxy-ing any incoming traffic to one or several upstream Nextcloud instances.)

kwisatz commented 3 years ago

@floriansimon1 in the case this would be a web proxy, the request module has a proxy option that we'd have to pass on to webdav-client. See https://github.com/request/request#proxies.

ghost commented 3 years ago

Hi guys, I wrote an API that can be used to manage multiple Nextcloud instances. The setup is based on FreeBSD and not on Docker. Therefore I cannot immediately provide you @floriansimon1 with a docker-compose file. In the meantime I have found out that request is not to blame. The FreeBSD jail didn't listen to the interface. After a named restart, it worked. Accordingly, everything works as @kwisatz has mentioned.

Sorry for the circumstances and thank you for the great work on this project!

Best regards