title: IOS app distribution over-the-air : error when download can't connect to domain
body: <p>we are currently deploying a new app over the air on IOS and Android, android no problem to download an apk on internet with a simple link, but on IOS we are currently on a issue when we try to access to the server from the download link.
  "Cannot connect to "domain.com" "</p>
  
  <p>I don't know what is wrong : the plist is good and ipa too, i checked all links with my browser.</p>
  
  <p>The MIME TYPES for plist and ipa are :
  plist : text/xml
  ipa : application/octet-stream</p>
  
  <p>The https:// port is customized to 8443
  <a href="https://domain.com:8443/webapp/app.html" rel="nofollow">https://domain.com:8443/webapp/app.html</a></p>
  
  <p>download link :</p>
  
  <pre><code>&lt;p&gt;&lt;a href="itms-services://?action=download-manifest&amp;url=https://domain.com:8443/webapp/app.plist"&gt;DownLoad Iphone APP&lt;/a&gt;&lt;/p&gt;
  </code></pre>
  
  <p>plist file like this :</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
  &lt;plist version="1.0"&gt;
  &lt;dict&gt;
          &lt;key&gt;items&lt;/key&gt;
          &lt;array&gt;
                  &lt;dict&gt;
                          &lt;key&gt;assets&lt;/key&gt;
                          &lt;array&gt;
                                  &lt;dict&gt;
                                          &lt;key&gt;kind&lt;/key&gt;
                                          &lt;string&gt;software-package&lt;/string&gt;
                                          &lt;key&gt;url&lt;/key&gt;
                                          &lt;string&gt;https://domain.com:8443/webapp/app.ipa&lt;/string&gt;
                                  &lt;/dict&gt;
                          &lt;/array&gt;
                          &lt;key&gt;metadata&lt;/key&gt;
                          &lt;dict&gt;
                                  &lt;key&gt;bundle-identifier&lt;/key&gt;
                                  &lt;string&gt;com.app.myapp&lt;/string&gt;
                                  &lt;key&gt;bundle-version&lt;/key&gt;
                                  &lt;string&gt;1.3&lt;/string&gt;
                                  &lt;key&gt;kind&lt;/key&gt;
                                  &lt;string&gt;software&lt;/string&gt;
                                  &lt;key&gt;title&lt;/key&gt;
                                  &lt;string&gt;myapp&lt;/string&gt;
                          &lt;/dict&gt;
                  &lt;/dict&gt;
          &lt;/array&gt;
  &lt;/dict&gt;
  &lt;/plist&gt;
  </code></pre>
  
  <p>My web server is behind a reverse proxy nginx that work well (there is an translation 8443 to 8080 between reverse proxy and webserver) etc.</p>
  
  <p>The log of reverse proxy show this when i try to download the app, strangly i get an 503 error, but all browser like chrome which got the .ipa has an HTTP response 200 OK, but when i click on download on my iphone i get an 503 error on nginx log :</p>
  
  <pre><code>2014/05/16 16:05:02 [debug] 7217#0: *18845 http script copy: "^M
  "
  2014/05/16 16:05:02 [debug] 7217#0: *18845 http script copy: ""
  2014/05/16 16:05:02 [debug] 7217#0: *18845 http script copy: ""
  2014/05/16 16:05:02 [debug] 7217#0: *18845 http proxy header: "Accept-Encoding: gzip, deflate"
  2014/05/16 16:05:02 [debug] 7217#0: *18845 http proxy header: "User-Agent: itunesstored/1.0 iOS/7.1.1 model/iPhone3,1 build/11D201 (4; dt:27)"
  2014/05/16 16:05:02 [debug] 7217#0: *18845 http proxy header: "Accept-Language: fr"
  2014/05/16 16:05:02 [debug] 7217#0: *18845 http proxy header: "Accept: */*"
  2014/05/16 16:05:02 [debug] 7217#0: *18845 http proxy header:
  "GET /webapp/app.plist HTTP/1.1^M
  Connection: upgrade^M
  Accept-Encoding: gzip, deflate^M
  User-Agent: itunesstored/1.0 iOS/7.1.1 model/iPhone3,1 build/11D201 (4; dt:27)^M
  Accept-Language: fr^M
  Accept: */*^M
  ^M
  "
  2014/05/16 16:05:02 [debug] 7217#0: *18845 http cleanup add: 0000000002149C20
  2014/05/16 16:05:02 [debug] 7217#0: *18845 get rr peer, try: 1
  2014/05/16 16:05:02 [debug] 7217#0: *18845 socket 14
  2014/05/16 16:05:02 [debug] 7217#0: *18845 epoll add connection: fd:14 ev:80000005
  2014/05/16 16:05:02 [debug] 7217#0: *18845 connect to 10.xx.xx.xxx:8080, fd:14 #18846
  2014/05/16 16:05:02 [debug] 7217#0: *18845 http upstream connect: -2
  2014/05/16 16:05:02 [debug] 7217#0: *18845 posix_memalign: 00000000020D2C20:128 @16
  2014/05/16 16:05:02 [debug] 7217#0: *18845 event timer add: 14: 90000:1400249192473
  2014/05/16 16:05:02 [debug] 7217#0: *18845 http finalize request: -4, "/webapp/app.plist?" a:1, c:2
  2014/05/16 16:05:02 [debug] 7217#0: *18845 http request count:2 blk:0
  2014/05/16 16:05:02 [debug] 7217#0: *18845 http run request: "/webapp/app.plist?"
  2014/05/16 16:05:02 [debug] 7217#0: *18845 http upstream check client, write event:1, "/webapp/app.plist"
  2014/05/16 16:05:02 [debug] 7217#0: *18845 http upstream recv(): -1 (11: Resource temporarily unavailable)
  2014/05/16 16:05:02 [debug] 7217#0: *18845 http upstream request: "/webapp/app.plist?"
  2014/05/16 16:05:02 [debug] 7217#0: *18845 http upstream send request handler
  2014/05/16 16:05:02 [debug] 7217#0: *18845 http upstream send request
  2014/05/16 16:05:02 [debug] 7217#0: *18845 chain writer buf fl:1 s:231
  2014/05/16 16:05:02 [debug] 7217#0: *18845 chain writer in: 0000000002149C58
  2014/05/16 16:05:02 [debug] 7217#0: *18845 writev: 231
  2014/05/16 16:05:02 [debug] 7217#0: *18845 chain writer out: 0000000000000000
  2014/05/16 16:05:02 [debug] 7217#0: *18845 event timer del: 14: 1400249192473
  2014/05/16 16:05:02 [debug] 7217#0: *18845 event timer add: 14: 90000:1400249192474
  2014/05/16 16:05:02 [debug] 7217#0: *18845 http upstream request: "/webapp/app.plist?"
  2014/05/16 16:05:02 [debug] 7217#0: *18845 http upstream process header
  2014/05/16 16:05:02 [debug] 7217#0: *18845 malloc: 000000000219B170:4096
  2014/05/16 16:05:02 [debug] 7217#0: *18845 recv: fd:14 1038 of 4096
  2014/05/16 16:05:02 [debug] 7217#0: *18845 http proxy status 503 "503 Service Unavailable"
  2014/05/16 16:05:02 [debug] 7217#0: *18845 http proxy header: "Content-Type: text/html; charset=UTF-8"
  2014/05/16 16:05:02 [debug] 7217#0: *18845 http proxy header: "Content-Length: 785"
  2014/05/16 16:05:02 [debug] 7217#0: *18845 http proxy header: "Connection: close"
  2014/05/16 16:05:02 [debug] 7217#0: *18845 http proxy header: "Expires: Thu, 19 Nov 1981 08:52:00 GMT"
  2014/05/16 16:05:02 [debug] 7217#0: *18845 http proxy header: "Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0"
  2014/05/16 16:05:02 [debug] 7217#0: *18845 http proxy header: "Pragma: no-cache"
  2014/05/16 16:05:02 [debug] 7217#0: *18845 http proxy header done
  2014/05/16 16:05:02 [debug] 7217#0: *18845 finalize http upstream request: 503
  2014/05/16 16:05:02 [debug] 7217#0: *18845 finalize http proxy request
  2014/05/16 16:05:02 [debug] 7217#0: *18845 free rr peer 1 0
  </code></pre>