I want to use the Docker installation rather than manual installation (docker-compose image works fine, no problem accessing it under port 3000) but I want to change CodiMD’s web installation folder from root to a subdir, i.e. from http://localhost:3000/ to http://localhost:3000/codimd – is that possible? Any pointers?
Right now I notice the html content points to absolute urls such as <img src="/screenshot.png" /> .
I take it I’d need to edit the docker image to change the internal web server’s config to serve the static files at the /codimd url instead of at /, and then also set CMD_URL_PATH=codimd in the docker env variables.
Setting only CMD_URL_PATH=codimd does changes the html output of localhost:3000/ and shows broken images and css, there is nothing at localhost:3000/codimd
Setting only CMD_URL_PATH=codimd and also changing app.js to read app.use('/codimd', express.static(path.join(__dirname, '/public'), { maxAge: config.staticCacheTime, index: false })) ends up in a redirect loop between /codimd/ and /codimd` (not the missing trailing slash)
I’d be grateful for some more exact pointers on how to do this.
The end goal is to put the CodiMD docker under a proxypass such that mydomain.com/codimd proxy-passes to localhost:3000/codimd (I can do a few things by rewriting html output, but that’s not cutting it, as some CSS would also need to, it would be just cleaner to have CodiMD installed in a web subdir)
(small housekeeping notice: I moved this question into its own topic, this way it will probably get more attention and it can be resolved once it’s achieved. Feel free to change the topic name, my attempt may be a bit short)
Thanks to some contributors this feature was fixed in 1.6.0. If you are already running 1.6.0 and it’s an issue, it would help a lot when you share your config (of course without secrets) to have us reproducing the issue.
That is great to hear, but how exactly do I configure the Docker image to achieve my goal of serving web files from /codimd instead of /? Just adding CMD_URL_PATH=codimd wouldn’t be enough. I’d be grateful for some specific instructions.
Yes, as I said, the idea is to use a reverse-proxy so i can access CodiMD at https://domain.com/codimd.
I use Apache, not Nginx. Regardless, your example won’t work if CodiMD does not serve files from a subdirectory, because the links in the html, css, js will point to /.
Do you have a working version of a CodiMD deployment at a url like https://domain.com/codimd which uses the CodiMD docker image (not manual deployment). If yes, would you mind sharing the setup of the web server and Docker image?