The temperary solution to switch language of Caloch.cn successfully with toolbar dropdown.

2020年6月12日星期五

This is an error caused by Tencent cloud machine policy, they have a rule called elastic IP, which is a paid service, if you do not pay for that, your server IP will be 127.0.0.1, but we have paid the domain name, as well we the cloud server, however, our site is fetching IP through request, so it always gets 127.0.0.1 if it is redirecting via code, the owner still hasn't customized the code yet, so, if you want to change the language and currency, just change the 127.0.0.1 to caloch.cn manually, and if you are a registered user, next time, you will visit the site with the settings you configured.

写下您的评论
评论
2020-6-22 下午11:08
Host file usage

Awesome, Linux, add a host record to redirect 127.0.0.1 to the public site address?

2020-6-22 下午11:27
The 127.0.0.1 is in client side.

Sadly, address written in client side code won't resolve the destination by hosts file:(

2020-6-23 下午3:31
This has been solved.

The final solution for this problem is, after tracing the code, the owner found the two dropdowns are calling a method called "setLocation" in js, and he replaced all '127.0.0.1' to
'caloch.cn'. So this functionality is OK now. Switching languages manually. Great!

2020-6-24 下午10:09
About the root cause.

There is a method writing host address to front-end, but it might be the last option the owner will take to modify back-end code, maybe in the future, coz, he wants to keep the integrity of the source code.

2020-6-28 下午4:00
Solved by re-configuring our reverse proxy.

Nginx configuration missing caused the problems, now the owner is focusing on solving it by adding extra Nginx configurations, almost all fixed.