Run on subpath
I'd like to run the app/container on a subpath (e.g. /mat2web
), though nginx but also flask seems to always assume to run on /
. So script and assets path are always starting with /
.
I do not yet fully understand how flask & uwsgi plays together with regards to have it run on a subpath and whether any code change is actually needed (except for config changes), BUT it likely requires some adaption of the nginx templates on the fly.
My proposal would be to have the entrypoint checking on a ENV variable (e.g. MAT2WEB_SUBPATH) and if present, rewrite the templates (maybe nginx can even do it dynamically) and make sure flask is aware of it (e.g. by setting SCRIPT_NAME).
Motiviation: This would allow to bundle mat2web with other webapps, without having to host in on a separate subdomain.