CADDY as reverse proxy

Description

Good evening,

I’m very excited to try out Rocketchat but I can’t get it working with CADDY.

Does anyone have it working? Can you please share with me what I should put in my Caddyfile?

The recommended Caddyfile syntax posted in the Rocketchat doc’s is incorrect and doesn’t work. I ran this by the caddy.community and it stumped their deveolopers.

Server Setup Information

  • Version of Rocket.Chat Server: 6
  • Operating System: Ubuntu
  • Deployment Method: docker
  • Number of Running Instances: 1
  • DB Replicaset Oplog:
  • NodeJS Version:
  • MongoDB Version: 4
  • Proxy:
  • Firewalls involved:

Any additional Information

This the entry we have for Rocket.chat in our CaddyFile:

<Your rocket.chat URL here> {

        reverse_proxy <your rocket.chat host name or IP address here>:3000 {
                header_up Host {http.request.host}
                header_up X-Real-IP {http.request.remote}
                header_up X-Forwarded-Port {http.request.port}
                header_up Connection {http.request.header.Connection}
                header_up Upgrade {http.request.header.Upgrade}
        }
}

Note that the URL must point to your Caddy server, while the reverse proxy address is the name/IP address of the chat server, which must be different. It assumes that Rocket.chat is configured for the default port of 3000.

thanks for this!

I was excited to try it but I’m still having issues getting it to work. I think possibly I don’t have my rocket chat setup correctly even though the server is currently posting this under logs:

[2024-03-18T04:35:25.587Z] INFO  0e6dd6f9-c9ee-4927-93f9-54e96242470c/BROKER: ✔                                                                              ServiceBroker with 2 service(s) started successfully in 740ms.
(node:1) [MONGODB DRIVER] Warning: cursor.count is deprecated and will be remove                                                                             d in the next major version, please use `collection.estimatedDocumentCount` or `                                                                             collection.countDocuments` instead
+-----------------------------------------------+
|                 SERVER RUNNING                |
+-----------------------------------------------+
|                                               |
|  Rocket.Chat Version: 6.3.12                  |
|       NodeJS Version: 14.21.3 - x64           |
|      MongoDB Version: 4.4.15                  |
|       MongoDB Engine: wiredTiger              |
|             Platform: linux                   |
|         Process Port: 3000                    |
|             Site URL: https://chat.naff.casa  |
|     ReplicaSet OpLog: Enabled                 |
|          Commit Hash: 72f3ce7dba              |
|        Commit Branch: HEAD                    |
|                                               |
+-----------------------------------------------+
+----------------------------------------------------------------------+
|                              DEPRECATION                             |
+----------------------------------------------------------------------+
|                                                                      |
|  YOUR CURRENT MONGODB VERSION (4.4.15) IS DEPRECATED.                |
|  IT WILL NOT BE SUPPORTED ON ROCKET.CHAT VERSION 7.0.0 AND GREATER,  |
|  PLEASE UPGRADE MONGODB TO VERSION 5.0 OR GREATER                    |
|                                                                      |
+----------------------------------------------------------------------+

I have 20ish other services that i’ve been running using caddy for over 2 years so I have a working setup but I’m not sure why Rocket chat is giving me so many issues…

Maybe i"ll just scrap it – hopefully this post helps someone else.