I have a cURL-based script for sending push notifications to iOS. While it works perfectly on my local machine, I'm encountering issues when running it on an AWS EC2 instance. The instance is running Ubuntu (22.04.3) and aaPanel (6.8.30) with NGINX (1.21.4) and PHP (8.1.21).
Whenever I execute the script on the AWS EC2 instance, I encounter the following error message:
b"\0\0\x18\x04\0\0\0\0\0\0\x01\0\0\x10\0\0\x03\0\0\0\x01\0\x05\0\0@\0\0\x06\0\0\x1F@\0\0u\x07\0\0\0\0\0\x7Fÿÿÿ\0\0\0\x01Unexpected HTTP/1.x request: POST /3/device/[deviceTokenCensored] "
After researching online, it seems that enabling HTTP2 could potentially resolve the issue. I noticed that when I checked phpinfo()
, the status of HTTP2 under CURL was "No". It's worth noting that the website hosted on NGINX is SSL activated. However, I haven't been able to find a definitive solution for enabling HTTP2.