-2

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 :)

2 Answers 2

1

One of two ways:

  1. You point your local clients to a DNS server in your intranet that serves the internal IP address of your webserver for all requests going to myapp.example.com/appname (you have to use the appname in the URL or a simple IP mapping won't work).
  2. You change the DNS settings of example.com and add an A record that points to the internal IP address of your webserver. Fortunately, people outside the network won't be able to access your internal network, but they will know the (internal private) IP address of the server, which can be a security concern.

I'd suggest #1, if you can. You can normally do this on your router (it is generally your DNS server).

4
  • I am not so confident with this DNS stuff, but would it be possible to create a CNAME record on example.org so that myapp.example.org queries myapp.local? May 20, 2015 at 19:35
  • Yes, that would work perfectly.
    – IceMage
    May 20, 2015 at 19:47
  • THANK YOU! :))) Can I marry you? ;P May 20, 2015 at 19:50
  • Step in line lol.
    – IceMage
    May 20, 2015 at 20:01
-1

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.

1
  • 2
    Because it was never good practice, and it is even worse now that any arbitrary string can be a TLD. May 8, 2019 at 16:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .