spotify / luigi

Luigi is a Python module that helps you build complex pipelines of batch jobs. It handles dependency resolution, workflow management, visualization etc. It also comes with Hadoop support built in.
Apache License 2.0
17.85k stars 2.39k forks source link

using default_scheduler_url as a mounting point (not root `http://address/mount`) behind proxy not working #3213

Closed franckOL closed 1 year ago

franckOL commented 1 year ago

I need to mount luigi behind a nginx, for example luigi at http://address/mount. For that I configure:

[core]
default_scheduler_url=http://address/mount
....

GUI is ok and works but, CLI not due to url resolution. it happens there https://github.com/spotify/luigi/blob/c13566418c92de3e4d8d33ead4e7c936511afae1/luigi/rpc.py#L54

To understand what happened:

parsed=urlparse('http://address/mount')
url='/api/add_task'
urljoin(parsed.geturl(), url)
# ==> give 'http://address/api/add_task'
# expected http://address/mount/api/add_task

What I must do for working - slash at the end of mount point, no slash for url -:

parsed=urlparse('http://address/mount/')
url='api/add_task'
urljoin(parsed.geturl(), url)
# ==> http://address/mount/api/add_task
honnix commented 1 year ago

I think having the slash is expected.