Solved [JAPAN only] HTTP 502 Bad Gateway error for most of add-ons, scripts, and skins
#96
Thanks Kib for interesting information. It's helpful as I'm not familiar with Kodi site system.

Here is my humble thoughts seeing new info.

Kodi site successfully detect my server is in Japan.
Code:
$ wget -q -O - "http://mirrors.kodi.tv/addons/isengard/context.artwork.downloader.auto/context.artwork.downloader.auto-1.0.1.zip?mirrorlist" | egrep "You are connecting|We " | sed 's/<[a-z/ ]*>//g'
You are connecting with IP address 52.192.61.254, which belongs to autonomous system Amazon.com, Inc. (ASN16509).
We believe you are near Tokyo in Japan and have selected mirrors based on this.

And when I added "X-Forwarded-For", Kodi site failed to detect my site. (Maybe geoip consider proxy-ed connection is unable to detect source IP.)
Code:
$ wget --header="X-Forwarded-For: unknown" -q -O - "http://mirrors.kodi.tv/addons/isengard/context.artwork.downloader.auto/context.artwork.downloader.auto-1.0.1.zip?mirrorlist" | egrep "You are connecting|We " | sed 's/<[a-z/ ]*>//g'
You are connecting with IP address unknown, which belongs to autonomous system  (ASN0).
We were not able to use your IP to approximate your location, so have chosen the mirrors at random.

I checked multiple machine in different location, and this symptom is same.

Considering the fact that adding "X-Forwarded-For" avoid the problem, I now think;
(a) the code to detect client region by IP source location does not have problem
(b) the code to select one mirror to redirect have a problem when "Japan" is supplied to the code


Also, as for farcus's finding -- some URL succeed and some is not.
This is also same at my place, and adding "X-Forwarded-For" resolved the issue too.
So I guess Kib's trick to add "X-Forwarded-For" is applied only to some particular URLs (not applied to all URLs).


Hope this helps some.


Messages In This Thread
RE: [JAPAN only] HTTP 502 Bad Gateway error for most of add-ons, scripts, and skins - by toinit - 2016-02-03, 18:47


Logout Mark Read Team Forum Stats Members Help
[JAPAN only] HTTP 502 Bad Gateway error for most of add-ons, scripts, and skins1
This forum uses Lukasz Tkacz MyBB addons.