0

Riddle me this dear Stack Overflow gurus.

I have an aws EC2 instance. I have exposed the ports on the security group associated with the EC2 instance, and on the firewall (ufw). I have an IoT device that sends http requests to an endpoint.

If I configure nginx to listen on port 80, the access_log shows that it does not receive a request from my IoT device. If I listen on port 50008, my request is received just fine. Sending requests on either port from the browser (port 80) or from Insomnia http client (both ports) results in both requests successfully received on the server.

I cannot for the life of me figure out why.

IoT device with the following specs:

1) Particle Electron (GSM module and STM micro). 2) using the http_client library

Some suggestions: 1)The sim card of the IoT device has data and internet connectivity with particle services. 2)The firewall and aws security group are configured to allow all connections on the ports

Changing the ports and restarting the nginx service with root privileges is all I need to go from receiving nothing (on port 80, port 1024 and port 1025), to receiving the full request (port 50008). I have not tested any more ports where it works.

Is there some issue with IoT devices and certain ports?

Any help will be appreciated.

Thanks.

Freddie
  • 13
  • 3
  • Can you provide nginx logs? – Alexander Altshuler Mar 21 '18 at 20:24
  • Hi. Thanks for the reply. Which logs would you like? There are no nginx access logs at all when I send the request to port 80 (and nginx is listening on port 80). The only logs I can see are when I change to port 50008, in which case you jsut see the request coming through, as you should. – Freddie Mar 23 '18 at 08:26
  • it looks like permission issue, try something like 8080 port, if it would work - nginx doesn't have enough right to listen on low ports – Alexander Altshuler Mar 23 '18 at 09:24

0 Answers0