Cannot serve Galaxy-ng using relative path in nginx

Hi,
I’ve installed galaxy-nx in a kubernetes environment and now i want to serve it using nginx using a relative path. For example: http://<ip_adress>/galaxy-ng.

I’ve tried to do this but it dind’t work. I also dind’t find any env var to do this. Can anyone teld me how to do it?

Thank you in advance.

How have you deployed Galaxy-NG to your k8s environment? Did you use an operator or helm chart?

I’ve deploy it manually using yml files. But the case is, how can i configure galaxy-ng app to serve it using a relative path in nginx?

I say it because before I have deployed other apps using relative path in nginx like local gitlab or apache airflow but now i cannot do it with galaxy-ng

I’m going to first make the same recommendation that @kurokobo did.

Deploying from the operator will help you see how the configuration should look in k8s to begin with.

Then you can scale down the operator, and modify the config file manually and roll the pods to pick up changes.

You’ll need to set:

GALAXY_API_PATH_PREFIX = '/galaxy-ng/api/galaxy'
CONTENT_PATH_PREFIX = '/galaxy-ng/api/galaxy/pulp/api/v3/artifacts/collections/'
API_ROOT = '/galaxy-ng/api/galaxy/pulp/'
STATIC_ROOT = '/galaxy-ng/app/galaxy_ng/app/static/'

The above is not an exhaustive list, but the point is you will need to set every URI path related setting to account for the fact you’re placing everything under http://<ip_address>/galaxy-ng

You may also need to account for things like:
ANSIBLE_API_HOSTNAME, CONTENT_ORIGIN, CORS_ORIGIN_WHITELIST, CSRF_TRUSTED_ORIGINS, TOKEN_SERVER among other things

That being said, I haven’t seen a /ui/ specific path setting, so I’m not sure that the UI itself even supports relative paths.

1 Like

@Alonso_Diaz_Sobrino I think there may be a couple other options:

  1. Nginx can do path rewrites, so rather than modifying all of the galaxy paths in the settings.py file, you can tell nginx to rewrite the relative paths. I don’t have any specific instructions for this though, since I haven’t done it and have a love-hate relationship with nginx configs.

  2. Nginx can listen under multiple server names, so instead of changing relative paths for Galaxy-NG, you could do an alternate hostname instead. You would need to add a dns record for your nginx host (and add it to your cert if you’re doing https, or use wildcards).