how can I implement 1 website domain with multiple web server to serve users at different countries?

StackOverflow https://stackoverflow.com/questions/13783331

  •  05-12-2021
  •  | 
  •  

質問

We have a asp.net web application hosted in the UK and our clients from China and Korean report that the speed for viewing the web application is extremely slow -

(most data are saved as non-database driven files)

We decided to have a second web server set up in China to solve the issue - however, is that possible that we can keep both UK server and China server using the same domain name? (The clients are used to using our old web url, so it will be very difficult to announce such as change to those non-technical users...)

役に立ちましたか?

解決

You would need to do that on DNS level when you want to use the same domain name. One way may be to use a geolocation-aware domain name server.

However, much easier would be to permanently redirect your users to their regional URL, for example set up your app on two sites:

http://app-emea.yourdomain.com
http://app-apac.yourdomain.com
http://app-amer.yourdomain.com

When your users access the old site at app.yourdomain.com, let your web application check their Accept-Language HTTP header (or their IP address) to find out their origin. Then respond with a HTTP status code 301 (Permanently Moved) with the new location, e.g. app-apac.yourdomain.com

Over time, your users will bookmark the new addresses or they are redirected automatically. That should not confuse them and you don't need to announce anything, since they don't have to change anything on their end. If you want to hide the internal URL so the location bar of the browser only shows the original URL, you could use an iframe but i don't recommend this solution (it's ugly).

http://app.yourdomain.com
<html>
 <body>
  <iframe src="http://app-apac.yourdomain.com"/>
 </body>
</html>
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top