Cannot connect to database

I have installed neo4j on AWS and opened the browser on my windows laptop. However I cannot connect to a database. The browser says "use server connect". I click "connect" and it just says "server is taking a long time to respond". Tried with neo4j and bolt. Same thing. I have edited the conf file to disable authentication but still cannot connect.

Anyone?

This seems to be intermittent. I can connect sometimes and run a simple query such as count nodes. Then it disconnects again. Sometimes I get a few hours working. Other times it disconnects every few seconds. I have disabled all extensions. There are messages in the browser console mostly "websocket connection failed" and "WebSocket is closed before the connection is established.".