let's say
1) I have a server running in a private intranet. It uses tomcat to serve a webapp at privateserverip:8080/appname
2) I have a myapp.local domain and when I enter it toplevel with http://myapp.local it serves the app from privateserverip:8080/appname if the request comes from within the intranet
That is the actual state.
Now: I have a public domain: example.org and I want that if a website redirects a user, who is in the intranet (!), to myapp.example.org, privateserverip:8080/appname should be served. If somebody from outside the intranet hits myapp.example.com nothing should happen.
Please tell me that this is possible!? :)
I could configure vhost in an nginx at example.com but also create DNS entries and stuff like that for example.com. Everything you want. Just tell me that this is possible
Thanks for your help :)
One of two ways:
I'd suggest #1, if you can. You can normally do this on your router (it is generally your DNS server).
Why do people keep mixing private and public? There is nothing wrong about internal users connecting to the private url (http://myapp.local) and external users connecting to the public url (http://myapp.example.org). Anything else is just a workaround to the good practices.