#Discrepancy between

4 messages · Page 1 of 1 (latest)

steep fossilBOT
#

Hi @rugged flame. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

The discrepancy in your HTTP Actions URLs between your self-hosted Convex instance (<https://backend.ripplediary.com/http/revenuecat/webhook>) and the cloud-hosted Convex instance (<https://my.site/revenuecat/webhook>) is due to how the self-hosted backend is configured to expose HTTP Actions.

Why does this happen?

In the Convex cloud product, HTTP Actions are served directly at the root of your custom domain (e.g., <https://my.site/revenuecat/webhook>). When self-hosting, by default, the backend exposes HTTP Actions under the /http path (e.g., <https://backend.ripplediary.com/http/revenuecat/webhook>). This is a difference in routing between the cloud and self-hosted setups.

This behavior is reflected in the documentation, which states:

The backend listens on <http://127.0.0.1:3210.> The backend's http actions are available at <http://127.0.0.1:3211.>

Set up routing to forward requests from your domain to these ports. For example:

  • <https://api.my-domain.com> forwards to <http://localhost:3210>
  • <https://my-domain.com> forwards to <http://localhost:3211>

In a .env file beside the docker-compose.yml file, set the following environment variables:

CONVEX_CLOUD_ORIGIN='<https://api.my-domain.com'>
CONVEX_SITE_ORIGIN='<https://my-domain.com'>

source

If you set CONVEX_SITE_ORIGIN to your main domain (e.g., <https://my-domain.com>), HTTP Actions will be served at the root, matching the cloud behavior. If you set it to a subdomain or a path (e.g., <https://backend.ripplediary.com>), and your reverse proxy or routing setup forwards /http to the backend's HTTP Actions port, you'll see the /http prefix.

How to get rid of the /http prefix

#

To have your HTTP Actions served at the root (e.g., <https://backend.ripplediary.com/revenuecat/webhook>), you need to:

  1. Set up your reverse proxy/routing so that requests to the root path (not /http) are forwarded to the backend's HTTP Actions port (usually 3211).
  2. Set CONVEX_SITE_ORIGIN to the domain you want to use for HTTP Actions, without the /http path (e.g., <https://backend.ripplediary.com>).

Your current setup appears to be forwarding all traffic to the backend on port 3210, and not distinguishing between the main API and HTTP Actions. You need to ensure that requests to /revenuecat/webhook are routed to port 3211, not 3210.

Example:

  • Forward <https://backend.ripplediary.com/*> to <http://localhost:3211/*> (for HTTP Actions)
  • Set CONVEX_SITE_ORIGIN=<https://backend.ripplediary.com>

This will make your HTTP Actions available at <https://backend.ripplediary.com/revenuecat/webhook,> matching the cloud behavior.

References:

If you need to keep both the main API and HTTP Actions on the same domain, you will need a reverse proxy (like Nginx or Traefik) to route / to port 3210 and /revenuecat/webhook (or all HTTP Actions endpoints) to port 3211 accordingly.

If you need more specific configuration examples, let me know!

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:

#

@rugged flame Kapa.ai is still learning and improving, please let me know how I did by reacting below.