开发者

Http requests from external and internal IP

I have web server with Internet domain name. That server has 2 IP: Internal and External. My web application receives HTTP requests from Internet (external IP). If that web app makes HTTP request to other web server inside our Intranet network, but which also has 2 IP (external and internal), which IP will be used by first server? And if I receive request from Internet at开发者_JS百科 external IP how can I change IP to internal for doing HTTP requests to other server inside Intranet?


This will depend on your environment. For example,

  1. Are you using the same host header (e.g. www.mysite.com) for accessing the second web server from internal and external network? If no then use the internal host header while accessing the web server.

  2. If its same host header, to which IP it get resolved? You can have DNS configuration that so that the same host address will be resolved to internal IP if accessed from the internal site.

  3. You can always use IP based addressing - you have make sure that on 2 web server that if host header is IP address then it should get mapped to the web site. I would not recommend this approach because it brittle and depends upon binding the ip address to particular site.

  4. Finally, you can always use local hosts file on the first web server to register the second web server internal IP address under configured host header. Then requests using that host header on first web server will always use internal IP.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜