I host an ollama (https://ollama.com/) api on an ec2 instance. I would like to access it from my pythonanywhere server, but cannot.
I have set up the necessary inbound rules on ec2 instance to allow the ip address associated with my pythonanywhere URL.
I have tested the ollama api from my laptop. I enabled my home IP address in the inbound rules on the ec2 instance and it works fine.
I have also tested whether I can do any TCP connection to the ollama port (11434). I stop the ollama server, and I set netcat to listen on this port. I am able to connect to this port with netcat from my laptop successfully. I cannot connect to this port with netcat from the pythonanywhere instance.
There are two possibilities here:
- either I am consistently mistyping the pythonanywhere IP address in the inbound security rule on AWS (I may be, but this seems low probability)
- there is some reason why I cannot access the instance from my pythonanywhere instance.