Can I change the port number of sync gateway

On our customer’s WiFi network, ports 4984 and 4985 are not open and therefore sync is failing. Are those port numbers changeable to some other commonly open port numbers? If so, how does one go about making that change.

Thanks

Please see the configuration documentation for changing Sync Gateway ports:

https://developer.couchbase.com/documentation/mobile/2.0/guides/sync-gateway/config-properties/index.html#2.0/adminInterface

https://developer.couchbase.com/documentation/mobile/2.0/guides/sync-gateway/config-properties/index.html#2.0/interface

Our users need to sync via public wifi available at hospitals. Many hospitals seem to not allow Port 4984. Unfortunately we have no relationship with the hospitals and therefore can’t find out which port numbers are open. What port number would you suggest we use (perhaps from the list of common port numbers that are most likely open).

Thank you.

I don’t have insight into your particular use-case, but I highly suspect port 80, 443, and maybe 8080 are open. In these scenarios, I’d recommend running a load balancer on the publicly accessible port, and keep SG running on the defaults.

  • A reverse proxy may rewrite the URL of each incoming request in order to match the relevant internal location of the requested resource. For Sync Gateway the reverse proxy may map the Internet facing port 80 to the standard Sync Gateway public REST API port 4984.

Thank you for your reply. As the document you pointed to says, adding a Reverse Proxy Server would be the way to properly do this.

However, just to test things out, can we simply change the Sync Gateway config file to replace “interface”:":4984" with “interface”:":80"? Is there a downside to doing that?

Thank you.

Yes you can do that. The only downside I can think of is if you’re already running a web server over port 80 you will need to stop it first.

Everything is clear. Thank you for your help. Appreciate it.