After installing Discourse into a subfolder using
DISCOURSE_RELATIVE_URL_ROOT, and then using a custom variable that references an uploaded file in Admin -> Customize -> Themes -> Edit CSS/HTML, the URL generated in the CSS is wrong.
For example, if
/my/forum, the CSS generates a URL that looks like
/my/forum/my/forum/uploads/default/original/1X/... (note the repeated relative URL root).
If S3 is used, the URL generated looks like
As a workaround, using an absolute URL (with the appropriate CORS configuration on S3) works.