title: uvicorn error on AWS EC2 with uvicorn + fastapi
body: <p>I have a server running locally. When I run it on AWS EC2 and send a request from outside on port 8000, I get the following error:</p>
  <pre><code>$ uvicorn sql_app.main:app --host=&quot;0.0.0.0&quot; --port=8000
  INFO:     Started server process [9806]
  INFO:     Waiting for application startup.
  INFO:     Application startup complete.
  INFO:     Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
  WARNING:  Invalid HTTP request received.
  Traceback (most recent call last):
    File &quot;/home/ec2-user/.local/lib/python3.7/site-packages/uvicorn/protocols/http/h11_impl.py&quot;, line 170, in handle_events
      event = self.conn.next_event()
    File &quot;/home/ec2-user/.local/lib/python3.7/site-packages/h11/_connection.py&quot;, line 443, in next_event
      exc._reraise_as_remote_protocol_error()
    File &quot;/home/ec2-user/.local/lib/python3.7/site-packages/h11/_util.py&quot;, line 76, in _reraise_as_remote_protocol_error
      raise self
    File &quot;/home/ec2-user/.local/lib/python3.7/site-packages/h11/_connection.py&quot;, line 425, in next_event
      event = self._extract_next_receive_event()
    File &quot;/home/ec2-user/.local/lib/python3.7/site-packages/h11/_connection.py&quot;, line 367, in _extract_next_receive_event
      event = self._reader(self._receive_buffer)
    File &quot;/home/ec2-user/.local/lib/python3.7/site-packages/h11/_readers.py&quot;, line 73, in maybe_read_from_IDLE_client
      request_line_re, lines[0], &quot;illegal request line: {!r}&quot;, lines[0]
    File &quot;/home/ec2-user/.local/lib/python3.7/site-packages/h11/_util.py&quot;, line 88, in validate
      raise LocalProtocolError(msg)
  h11._util.RemoteProtocolError: illegal request line: bytearray(b'\x16\x03\x01\x02\x00\x01\x00\x01\xfc\x03\x03\x91\xa5\xe2Y\xf0\xa1\xdd\x1d+\x08\x1c\r\x15X\x1d@\x1e/\xb1N\x00\xb5\xe5\xec\xf3F\x1fm\x03\xa1{&gt; \xa80\xb4\x14\x1aUs\xaa\xcd\xc3&lt;s\xcd\xd1\x17\xdf3\x0e\xdbh\xd1c\x88}\x8c\x1f\xa5\x15\x9aa\x14I\x00 ')
  WARNING:  Invalid HTTP request received.
  Traceback (most recent call last):
    File &quot;/home/ec2-user/.local/lib/python3.7/site-packages/uvicorn/protocols/http/h11_impl.py&quot;, line 170, in handle_events
      event = self.conn.next_event()
    File &quot;/home/ec2-user/.local/lib/python3.7/site-packages/h11/_connection.py&quot;, line 443, in next_event
      exc._reraise_as_remote_protocol_error()
    File &quot;/home/ec2-user/.local/lib/python3.7/site-packages/h11/_util.py&quot;, line 76, in _reraise_as_remote_protocol_error
      raise self
    File &quot;/home/ec2-user/.local/lib/python3.7/site-packages/h11/_connection.py&quot;, line 425, in next_event
      event = self._extract_next_receive_event()
    File &quot;/home/ec2-user/.local/lib/python3.7/site-packages/h11/_connection.py&quot;, line 367, in _extract_next_receive_event
      event = self._reader(self._receive_buffer)
    File &quot;/home/ec2-user/.local/lib/python3.7/site-packages/h11/_readers.py&quot;, line 68, in maybe_read_from_IDLE_client
      raise LocalProtocolError(&quot;illegal request line&quot;)
  h11._util.RemoteProtocolError: illegal request line
  WARNING:  Invalid HTTP request received.
  Traceback (most recent call last):
    File &quot;/home/ec2-user/.local/lib/python3.7/site-packages/uvicorn/protocols/http/h11_impl.py&quot;, line 170, in handle_events
      event = self.conn.next_event()
    File &quot;/home/ec2-user/.local/lib/python3.7/site-packages/h11/_connection.py&quot;, line 443, in next_event
      exc._reraise_as_remote_protocol_error()
    File &quot;/home/ec2-user/.local/lib/python3.7/site-packages/h11/_util.py&quot;, line 76, in _reraise_as_remote_protocol_error
      raise self
    File &quot;/home/ec2-user/.local/lib/python3.7/site-packages/h11/_connection.py&quot;, line 425, in next_event
      event = self._extract_next_receive_event()
    File &quot;/home/ec2-user/.local/lib/python3.7/site-packages/h11/_connection.py&quot;, line 367, in _extract_next_receive_event
      event = self._reader(self._receive_buffer)
    File &quot;/home/ec2-user/.local/lib/python3.7/site-packages/h11/_readers.py&quot;, line 68, in maybe_read_from_IDLE_client
      raise LocalProtocolError(&quot;illegal request line&quot;)
  h11._util.RemoteProtocolError: illegal request line
  WARNING:  Invalid HTTP request received.
  </code></pre>
  <p>It would be very nice if you could tell me how to do it on port 80.</p>