Want reverse proxy but OctoPrint paths are absolute


I'm having problems setting up a reverse proxy for OctoPrint. The page displays and the webcam is showing, but the style sheet and any JavaScript seems to be lost. I want to access the OctoPrint computer using a link such as "www.mydomain.com/myfolder", that is, not at the root level.

Looking at the OctoPrint HTML page output source, I see that references to CSS, JavaScript, and a few other URLs are specified as absolute paths as they begin with a slash, e.g., "/static/css/..." (if I remember correctly). This makes it difficult, if not impossible(?), to setup a reverse proxy that redirects to a subdirectory, because if I understand the proxying correctly these URLs are resolved to "www.mydomain.com/static/..." instead of being relative to "myfolder".

Isn't this a bug in the OctoPrint code that should be fixed so that all internal URLs use relative paths for images, style sheets, etc.?


No, but you have to tell OctoPrint about the prefix it is supposed to use through an HTTP header which apparently your reverse proxy config isn't doing.