Thon Deboer
Thon Deboer

Reputation: 73

How do I configure label-studio to use a different root URL?

I want to serve labelstudio under a different path in stead of the root URL. I am using an AWS Load Balancer that has several other services and want to use /labelstudio/ as the root for label studio.

I tried to use something like setting env LABEL_STUDIO_BASE_URL=/labelstudio/

But that does not seem to work, since I am getting an error (Heidi’s down). I see 404 error in the log as well.

Label studio is a DJANGO app, and I am using the docker version as part of a docker compose setup,.

How do I configure labelstudio to use a different root URL?

Upvotes: 1

Views: 434

Answers (1)

Abdul Aziz Barkat
Abdul Aziz Barkat

Reputation: 21802

Django supports a setting FORCE_SCRIPT_NAME which is used by the URL resolver so that it generates URLs relative to the correct path. Looking at Label Studio's documentation you can set one of the following environment variables and that is used with the FORCE_SCRIPT_NAME (Figured this out by looking at their code):

  • HOST
  • LABEL_STUDIO_HOST

So you can set one of the above environment variables to a value like https://example.com/labelstudio for the part about the Django configuration.


Note: I am assuming you know how to configure the listeners for the AWS loadbalancer so that they forward traffic from specific URL prefixes to your deployment of Label Studio so I won't expand on that in this answer. See this page in the documentation for reference.

Upvotes: 0

Related Questions