This depends on what software you are using to reverse proxy.
I’m using Caddy and following Running Discourse with Caddy Server
Only change from the guide is adding the folder in the Caddyfile:
subfolder.muito.ninja
proxy /forum unix:/sock/nginx.http.sock {
transparent
}