nginx - Apple devices cannot access php pages, but can access html static resources
大家讲道理
大家讲道理 2017-05-31 10:34:34
0
2
762

[Original question: ios api link keeps timeout]

I am an API developer, and there are no problems when testing the API online.

But the developer on the IOS side reported an error saying that the NSURLCONNECTION request could not get a response because it was a timeout.

And he can get a response when he requests other https restAPIs.

Excuse me: Is this problem a server problem or an IOS developer problem?

[Additional explanation]

After looking at it again, I found that Safari could not open this website, but Chrome could.

I can ping the server, what is the reason?

[Additional explanation]

The latest discovered problem:
https://www.demo.com/index2.php cannot be accessed, but https://www.demo.com/index2.html can be accessed

My server configuration is lanmp, nginx proxy to apache

  • nginx-1.10.2

  • apache2.4

Is there any configuration error in nginx? I checked a lot of information, some said it was caused by http2 and some said it was caused by ssl.

[Replenish]

I have both apache and nginx logs, this is part of the log of the website involved

apache: All requests are 200 (using iPhone safari)

nginx: Also 200

大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

reply all(2)
我想大声告诉你

[After searching for nearly half a day, I finally found the solution]

Cause of the problem: The proxy configuration problem in nginx causes the HTTP2 request to not get the response correctly.

This is a problem with nginx proxy to apache. The nginx1.9+.x/apache2.4 proxy has this problem.

The solution is to configure nginx proxy:

proxy_hide_header Upgrade;

This issue was discussed on nginx: https://trac.nginx.org/nginx/...

【"Upgrade" header should not be proxied over h2】

漂亮男人

There is no need to give the certificate to iOS unless your https is the kind that requires payment for verification.
In addition, if other terminals can do it, it is generally not a server-side problem.
But I think there is something wrong with your tomcat configuration,

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template