Deployment behind reverse proxy with custom path #1540
Replies: 3 comments 2 replies
-
Yes, a PR to make this supported is welcome. I believe all you need is to change this line: https://github.com/livebook-dev/livebook/blob/main/config/config.exs#L5 To be:
You should do this inside this function: https://github.com/livebook-dev/livebook/blob/main/lib/livebook.ex#L85 And then follow the implementation of other env vars. :) |
Beta Was this translation helpful? Give feedback.
-
I have succeed to have the application working with a env variable! But I faced one issue, the frontend javascript assets must be redeployed and the env var must be configured in webpack for the scripts/css to be import with the url path. Socket endpoint must also be updated. I suggest to make a PR with code and config changes and create an alternate Dockerfile to be able to build with url path. When someone wants to use this feature, he have to clone the repo and rebuild the docker image with the url path. Like this with docker compose: version: "3"
services:
test-livebook:
build:
context: ./livebook
dockerfile: ./livebook/Dockerfile.redeployAssets
args:
- LIVEBOOK_BASE_URL=/livebook
container_name: test-livebook
environment:
- LIVEBOOK_PORT=8080
- LIVEBOOK_BASE_URL=/livebook
volumes:
- ./data:/data
ports:
- 8080:8080
restart: unless-stopped What do you think about it? Do you consider it as relevant? |
Beta Was this translation helpful? Give feedback.
-
I have open a PR to implement this feature 😃 |
Beta Was this translation helpful? Give feedback.
-
Hi all!
I try to deploy livebook (with docker) behind a reverse proxy to be accessible at an url like
https://subdomain.domain.com/livebook
.Nginx configuration:
I know this will not work for iframe using the port 8081. I would like to make first the application work.
The issue is that the path
/livebook
is not considered, I did not find any configuration or variable to configure the application base url.When I try to access
https://subdomain.domain.com/livebook
, I am redirect tohttps://subdomain.domain.com/authenticate
instead ofhttps://subdomain.domain.com/livebook/authenticate
. When I go onhttps://subdomain.domain.com/livebook/authenticate
, the/livebook
path misses in all assets urls.Is it currently possible to do a deployment like this?
May I propose a PR implementing a base url configuration variable?
Thanks for your work!
Beta Was this translation helpful? Give feedback.
All reactions