Installation on v-server as a subfolder with other services in subfolders using apache

Ah, I didn’t catch that before:

DISCOURSE_HOSTNAME: 'http://domain.com'

That’s wrong, you shoud only include the hostname itself, i.e. domain.com.