Thanks for trying to help. I guess I have to elaborate a bit more.
First I should explain what part I know well, and which I don’t ;). I do understand the low-level part pretty well. IP adresses, tcp etc. But I have no experience about the things a complex web application does. Also about email: How is an email sender authenticated, how is he checked not to send unathorized spam? (I do not expect you guys to explain all of that to me, just to clarify my questions..)
I do not have a full-blown company VPN infrastructure here, all I currently have is a private vpn subnet and ip-level rules.
Setup is like this: server has a publicly reachable domain, but all ports are closed except for the vpn entry point. Clients connecting to the vpn acquire a 10.0.x.x adress. Server is then reachable on 10.0.0.1:80.
My understanding (and I guess I am wrong here) is, that the server expects to be reachable itself on it’s domain.
Let’s say, I have domain xyz . com which resolves to public ip 8.7.6.5. clients use this domain/ip for the tunnel only. Once the tunnel is setup, their browsers connect to 10.0.0.1.
As I have said, I have no experience with Discourse. What I expect Discouse to use its own domain for are redirect actions. E.g. forwarding new clients which open 10.0.0.1 to 10.0.0.1/login.php. (Or similiar, just as an example). If Discourse would redirect them to xyz . com/login.php instead, they would be lost as the server is not reachable from outside the vpn. This is the type of expected issued I assume an internal address should be configured for.
When it comes to mail, I need to contact external mail servers. Public internet is reachable at any stage! I do not know much about this topic though. I just expect, connecting to a public mail server with “hey, I am 10.0.0.1 please send out some mails for me” will not work as I am using a private IP adress. Here I assume to need a public address.
Reading your answers optimistically, I assume, the configured domain is not used for client HTTP sessions. If the server is reachable under a private IP, and I connect to that IP, all self-referencing links and redirects are relative, so the user is not redirected to the domain the server expects to be connected on. I can just configure xyz.com as domain, and still open Discourse in the browser with 10.0.0.1, without being forwarded to (disfunct) xyz.com addresses.
I hope my question is somewhat clear. Sorry for being so confusing!
Oh, and HTTPS is not required. I even prefer not to use it - I am inside my tunnel and users do not need to be seperated securely. I would like to skip all these issues with cerificates and matching host names.