Solved [JAPAN only] HTTP 502 Bad Gateway error for most of add-ons, scripts, and skins
#51
I also experienced same error and I'm staying in Japan.

During checking the issue, I found some interesting things;

1. Reproduce

I can reproduce the issue by using simple wget;

Code:
$ wget http://mirrors.kodi.tv/addons/isengard/resource.language.ko_kr/resource.language.ko_kr-1.0.5.zip
...
Connecting to mirrors.kodi.tv|89.16.176.16|:80... connected.
HTTP request sent, awaiting response... 502 Bad Gateway
2016-01-02 12:20:36 ERROR 502: Bad Gateway.

Source IP address can be taken by;
Code:
$ curl ifconfig.co
52.11.156.178

Here is the list of IP addresses which I could check above.
(BTW, it's unfortunate that this wiki does not support table, or am I missing?)
Code:
| Source IP address | Place of source | Result          |
|-------------------|-----------------|-----------------|
| 52.11.156.178     | U.S.            | Success         |
| 54.173.187.11     | U.S.            | Success         |
| 52.77.246.142     | Singapore       | Success         |
| 52.192.219.178    | Japan           | 502 Bad Gateway |
| 1.79.73.212       | Japan           | 502 Bad Gateway |
| 211.135.205.192   | Japan           | 502 Bad Gateway |
| 61.121.241.17     | Japan           | 502 Bad Gateway |
| 118.87.165.135    | Japan           | 502 Bad Gateway |

This looks indicate that Japan is blocked while U.S. is not.

I guess nginx is configured to redirect to nearest mirror site according to IP source location, but there is some problem in the logic for some region in Asia, which caused 502 error. (just a guess, might be wrong.)


2. Workaruond

During checking, I found "X-Forwarded-For" header makes that access success.

Code:
$ wget --header="X-Forwarded-For: unknown" http://mirrors.kodi.tv/addons/isengard/resource.language.ko_kr/resource.language.ko_kr-1.0.5.zip
...
Connecting to mirrors.kodi.tv (mirrors.kodi.tv)|89.16.176.16|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://mirror.1000mbps.com/xbmc/addons/isengard/resource.language.ko_kr/resource.language.ko_kr-1.0.5.zip [following]
...
2016-01-02 17:37:12 (64.3 KB/s) - `resource.language.ko_kr-1.0.5.zip' saved [82591/82591]

This looks strange, but this is current behavior.
So using http proxy enable to access.

I have squid proxy server access, so I used it to install skins and others.
If you don't have such proxy server, I guess installing squid locally and use it, is easy workaround.

Hope this helps.


Messages In This Thread
RE: Keep getting HTTP 502 Bad Gateway error for most of add-ons, scripts, and skins - by toinit - 2016-01-02, 11:03
Logout Mark Read Team Forum Stats Members Help
[JAPAN only] HTTP 502 Bad Gateway error for most of add-ons, scripts, and skins1