# Issue with HTTP/2 and async file upload from Safari on iOS

**URL:** <https://www.ruby-forum.com/t/issue-with-http-2-and-async-file-upload-from-safari-on-ios/244730>\
**Category:** NGINX\
**Created:** [June 5, 2016, 1:17am UTC](https://www.ruby-forum.com/t/issue-with-http-2-and-async-file-upload-from-safari-on-ios/244730 "2016-06-05T01:17:50Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sadaf\_N](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/858c86/32.png) [@Sadaf\_N](https://www.ruby-forum.com/u/Sadaf_N)\
**Post date:** [June 5, 2016, 1:17am UTC](https://www.ruby-forum.com/t/issue-with-http-2-and-async-file-upload-from-safari-on-ios/244730/1 "2016-06-05T01:17:50Z")

</div>

Hi guys,  
I’m at my first deploy of Nginx with php-fpm after 10+ years of love  
with  
Apache and mod\_php. So far so (very) good.

I just have a peculiar issue with Safari on iOS. As you can read here

> <https://stackoverflow.com/questions/37635277/safari-on-ios-fails-to-ajax-upload-some-image-file-cannot-connect-to-server>

, my webapp allows the user to select an image, client-resize it via JS  
and  
then upload it via jQuery.

The problem is that Safari on iOS 9 sometimes fails the upload with the  
error

POST , Could not connect to the server.

I just found out that when I disabled the HTTP/2 form my server config  
the  
issue vanishes.

Is this a known issue somehow? Is there any other solution that doesn’t  
require me to go nuclear on HTTP/2?

Thanks for your help!

Posted at Nginx Forum:

> **[Issue with HTTP/2 and async file upload from Safari on iOS](https://forum.nginx.org/read.php?2,267385,267385#msg-267385)**
>
> Hi guys, I'm at my first deploy of Nginx with php-fpm after 10+ years of love with Apache and mod\_php. So far so (very) good. I just have a peculiar issue with Safari on iOS. As you can read here...

---

<div class="post-metadata">

**Author:** ![ZaneCEO](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/48db29/32.png) [@ZaneCEO](https://www.ruby-forum.com/u/ZaneCEO)\
**Post date:** [June 5, 2016, 1:31am UTC](https://www.ruby-forum.com/t/issue-with-http-2-and-async-file-upload-from-safari-on-ios/244730/2 "2016-06-05T01:31:16Z")

</div>

[https://trac.nginx.org/nginx/ticket/979](https://trac.nginx.org/nginx/ticket/979)  
[https://trac.nginx.org/nginx/ticket/959](https://trac.nginx.org/nginx/ticket/959)

It’s a known bug

---

<div class="post-metadata">

**Author:** ![ZaneCEO](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/48db29/32.png) [@ZaneCEO](https://www.ruby-forum.com/u/ZaneCEO)\
**Post date:** [June 6, 2016, 9:54am UTC](https://www.ruby-forum.com/t/issue-with-http-2-and-async-file-upload-from-safari-on-ios/244730/3 "2016-06-06T09:54:12Z")

</div>

Thank you very much!! At least now I know what’s going on! Let’s wait  
for a  
patch…

Posted at Nginx Forum:

> **[Re: Issue with HTTP/2 and async file upload from Safari on iOS](https://forum.nginx.org/read.php?2,267385,267408#msg-267408)**
>
> Hi guys, I'm at my first deploy of Nginx with php-fpm after 10+ years of love with Apache and mod\_php. So far so (very) good. I just have a peculiar issue with Safari on iOS. As you can read here...

---

<div class="post-metadata">

**Author:** ![ZaneCEO](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/48db29/32.png) [@ZaneCEO](https://www.ruby-forum.com/u/ZaneCEO)\
**Post date:** [June 6, 2016, 10:01am UTC](https://www.ruby-forum.com/t/issue-with-http-2-and-async-file-upload-from-safari-on-ios/244730/4 "2016-06-06T10:01:13Z")

</div>

On 6/6/16 10:53 AM, ZaneCEO wrote:

> Thank you very much!! At least now I know what’s going on! Let’s wait for a  
> patch…

It was fixed in 1.11.0 two weeks ago.

–  
Maxim K.

---

<div class="post-metadata">

**Author:** ![ZaneCEO](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/48db29/32.png) [@ZaneCEO](https://www.ruby-forum.com/u/ZaneCEO)\
**Post date:** [June 6, 2016, 12:01pm UTC](https://www.ruby-forum.com/t/issue-with-http-2-and-async-file-upload-from-safari-on-ios/244730/5 "2016-06-06T12:01:33Z")

</div>

Hello,

I’m using horde and observe similar errors since some weeks.  
Unsure if the same problem would be the reason.

Maxim K.:

> It was fixed in 1.11.0 two weeks ago.

I found one patch 'preread\_buffer.patch" attachtd to

> **[\#959 (Permit post before acking settings)
          – nginx](https://trac.nginx.org/nginx/ticket/959)**

That patch looks not trivial (to me)  
Would it be possible to publish a version for nginx-1.10.1, too

I would try if that solve the errors I observe.

Thanks  
Andreas

---

<div class="post-metadata">

**Author:** ![ZaneCEO](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/48db29/32.png) [@ZaneCEO](https://www.ruby-forum.com/u/ZaneCEO)\
**Post date:** [June 6, 2016, 12:05pm UTC](https://www.ruby-forum.com/t/issue-with-http-2-and-async-file-upload-from-safari-on-ios/244730/6 "2016-06-06T12:05:03Z")

</div>

On 6/6/16 1:00 PM, A. Schulze wrote:

> [#959 (Permit post before acking settings) – nginx](https://trac.nginx.org/nginx/ticket/959)  
> That patch looks not trivial (to me)  
> Would it be possible to publish a version for nginx-1.10.1, too
> 
> I would try if that solve the errors I observe.

Why don’t you just try 1.11.1?

The code difference between it and 1.10.1 (already released a week  
ago) is marginal.

–  
Maxim K.

---

<div class="post-metadata">

**Author:** ![ZaneCEO](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/48db29/32.png) [@ZaneCEO](https://www.ruby-forum.com/u/ZaneCEO)\
**Post date:** [July 8, 2016, 11:55pm UTC](https://www.ruby-forum.com/t/issue-with-http-2-and-async-file-upload-from-safari-on-ios/244730/7 "2016-07-08T23:55:33Z")

</div>

Hi guys,  
that’s the issue for me: I’m with Ubuntu 16.04 official packages. I apt  
dist-upgrade, but still I’m on nginx/1.10.0…

Any solution other than switching to  
[NGINX Mainline (1.15.x) : “Nginx” team](https://launchpad.net/~nginx/+archive/ubuntu/development) (wich scares  
the  
skull out of me, since this is a production server)?

Posted at Nginx Forum:

> **[Re: Issue with HTTP/2 and async file upload from Safari on iOS](https://forum.nginx.org/read.php?2,267385,268204#msg-268204)**
>
> Hi guys, I'm at my first deploy of Nginx with php-fpm after 10+ years of love with Apache and mod\_php. So far so (very) good. I just have a peculiar issue with Safari on iOS. As you can read here...

---

<div class="post-metadata">

**Author:** ![ZaneCEO](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/48db29/32.png) [@ZaneCEO](https://www.ruby-forum.com/u/ZaneCEO)\
**Post date:** [July 9, 2016, 12:35am UTC](https://www.ruby-forum.com/t/issue-with-http-2-and-async-file-upload-from-safari-on-ios/244730/8 "2016-07-09T00:35:51Z")

</div>

You can manually apply the patches and recompile.

Posted at Nginx Forum:

> **[Re: Issue with HTTP/2 and async file upload from Safari on iOS](https://forum.nginx.org/read.php?2,267385,268205#msg-268205)**
>
> Hi guys, I'm at my first deploy of Nginx with php-fpm after 10+ years of love with Apache and mod\_php. So far so (very) good. I just have a peculiar issue with Safari on iOS. As you can read here...

---

<div class="post-metadata">

**Author:** ![ZaneCEO](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/48db29/32.png) [@ZaneCEO](https://www.ruby-forum.com/u/ZaneCEO)\
**Post date:** [July 9, 2016, 12:26pm UTC](https://www.ruby-forum.com/t/issue-with-http-2-and-async-file-upload-from-safari-on-ios/244730/9 "2016-07-09T12:26:11Z")

</div>

> Any solution other than switching to  
> [NGINX Mainline (1.15.x) : “Nginx” team](https://launchpad.net/~nginx/+archive/ubuntu/development) (wich scares the  
> skull out of me, since this is a production server)?

Use nginx provided binaries if compiling from source is not an option:

> **[nginx: Linux packages](http://nginx.org/en/linux_packages.html#mainline)**

---

<div class="post-metadata">

**Author:** ![ZaneCEO](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/48db29/32.png) [@ZaneCEO](https://www.ruby-forum.com/u/ZaneCEO)\
**Post date:** [June 6, 2016, 8:21pm UTC](https://www.ruby-forum.com/t/issue-with-http-2-and-async-file-upload-from-safari-on-ios/244730/10 "2016-06-06T20:21:02Z")

</div>

The problem is, if (s)he is using the official packages, he will get the  
updates of the mainline channel, thus differing more and more from the  
stable channel which is supposed to be cheaper on features but with  
usable  
ones.

## My 2 cents,

_B. R._

---

<div class="post-metadata">

**Author:** ![ZaneCEO](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/48db29/32.png) [@ZaneCEO](https://www.ruby-forum.com/u/ZaneCEO)\
**Post date:** [July 11, 2016, 10:25am UTC](https://www.ruby-forum.com/t/issue-with-http-2-and-async-file-upload-from-safari-on-ios/244730/11 "2016-07-11T10:25:43Z")

</div>

@itpp2012 : building from source is a no-go for me due to future upgrade  
concerns

@Lukas : will follow your suggestion and try the ngingx-provided bins,  
thanks!

Posted at Nginx Forum:

> **[Re: AW: Issue with HTTP/2 and async file upload from Safari on iOS](https://forum.nginx.org/read.php?2,267385,268236#msg-268236)**
>
> Hi guys, I'm at my first deploy of Nginx with php-fpm after 10+ years of love with Apache and mod\_php. So far so (very) good. I just have a peculiar issue with Safari on iOS. As you can read here...

---

<div class="post-metadata">

**Author:** ![ZaneCEO](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/48db29/32.png) [@ZaneCEO](https://www.ruby-forum.com/u/ZaneCEO)\
**Post date:** [July 15, 2016, 2:26pm UTC](https://www.ruby-forum.com/t/issue-with-http-2-and-async-file-upload-from-safari-on-ios/244730/12 "2016-07-15T14:26:12Z")

</div>

> I was anticipating such a compatibility problem to be fixed in feature stable  
> but so far its looking like we will have to bite the bullet and move to mainline.  
> Would I be correct here? It seems for our case at least, feature stable HTTP2 is  
> not stable for production use at this time.

Correct. It has been stated multiple times that mainline is the  
suggested branch for HTTP2 use and that statement is still true.

So yes, do not use the stable branch if using HTTP2.

Lukas

---

<div class="post-metadata">

**Author:** ![ZaneCEO](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/48db29/32.png) [@ZaneCEO](https://www.ruby-forum.com/u/ZaneCEO)\
**Post date:** [July 15, 2016, 2:09pm UTC](https://www.ruby-forum.com/t/issue-with-http-2-and-async-file-upload-from-safari-on-ios/244730/13 "2016-07-15T14:09:15Z")

</div>

> On 11 Jul 2016, at 09:25, ZaneCEO [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> @itpp2012 : building from source is a no-go for me due to future upgrade  
> concerns
> 
> @Lukas : will follow your suggestion and try the ngingx-provided bins,  
> thanks!

I’m beginning to hear many reports now of Safari and iOS users hitting  
connection issues on several websites, not just around upload but any  
arbitrary POST it seems.  
Building from source is a no go too, and we’ve always stayed on the  
feature stable branch as it’s easier to maintain since we don’t need to  
worry about additional features causing issues.

I was anticipating such a compatibility problem to be fixed in feature  
stable but so far it’s looking like we will have to bite the bullet and  
move to mainline.  
Would I be correct here? It seems for our case at least, feature stable  
HTTP2 is not stable for production use at this time.

Jason
