Possible to update add url path prefix for /t and /c

AI-generated summary

shibi inquires about updating the default URL path prefix for Discourse to allow it to be served from a subfolder (e.g., /discourse) behind a load balancer, rather than using a subdomain. The goal is to route requests starting with /discourse to the Discourse instance and other paths to a separate API service.

supermathie responds by noting that this configuration is known as a subfolder install. However, they strongly advise against it, stating that switching applications based on hostname is much less complex.

hello-smile6 suggests an alternative approach: instead of moving Discourse, the user could configure the existing API service to use a different path prefix, such as /__api, which would simplify the routing setup.

shibi clarifies that the API service is already running and in use by other parties, implying that changing its path might not be feasible. pfaffman reinforces the recommendation to use subdomains, arguing that it is easier, has no downsides, and that users and search engines do not notice the hostname difference.

Finally, shibi confirms that the suggested solution is working, indicating that the subdomain approach was likely adopted or the issue was resolved through alternative means.

Update default url path prefix for /t and /c . The basic idea is I have domain and load balancer

I have a load balancer with two backend sets:

  1. API Service localhost:81.
  2. discourse on localhost:80.

I want to set up a routing policy as follows:

  • If the path starts with “/discourse” the request will be directed to discourse.
  • Otherwise, the request will be directed to API Service.

You are talking about a subfolder install.

However, it is much MUCH less complex to instead switch application based on hostname rather than path.

Why not make the API be at /__api or something? Wouldn’t that be easier than moving Discourse?

The service is already running and used by someone else

I’m echo they the subdomain is much easier and has no downside. People don’t notice the hostname anyway, and neither does Google.

Thanks this is working