[GH-ISSUE #1318] How to Open Ollama Service to the Outside World with HTTPS Compatibility? #685

Closed
opened 2026-04-12 10:21:58 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @rehberim360 on GitHub (Nov 29, 2023).
Original GitHub issue: https://github.com/ollama/ollama/issues/1318

Hello,

Problem: The Ollama service I've installed on Google VM doesn't seem to accept incoming requests over HTTPS. I'm aiming to allow external requests to reach the server and enable HTTPS support for the Ollama service. I've taken the following steps:

Server Configuration: I configured a reverse proxy using Apache2. I've correctly installed SSL/TLS certificates and attempted to establish a direct connection to the Ollama service.

Firewall Settings: I've set up the necessary firewall rules on Google Cloud and ensured that the correct ports are open.

Documentation and Research: I've reviewed the documentation regarding HTTPS support for the Ollama service but haven't found a definitive solution. I've searched forums and other resources but couldn't find a clear resolution.

Preferred Solution: I've noticed that enabling HTTPS support for Ollama requires specific configurations, yet I haven't found a straightforward approach.

Additional Information: Could any insights be shared regarding the server's current status, Ollama service configurations, or any hints related to HTTPS?

I would appreciate your assistance. I need guidance or suggestions to move forward with this issue. Thank you.

Originally created by @rehberim360 on GitHub (Nov 29, 2023). Original GitHub issue: https://github.com/ollama/ollama/issues/1318 Hello, Problem: The Ollama service I've installed on Google VM doesn't seem to accept incoming requests over HTTPS. I'm aiming to allow external requests to reach the server and enable HTTPS support for the Ollama service. I've taken the following steps: Server Configuration: I configured a reverse proxy using Apache2. I've correctly installed SSL/TLS certificates and attempted to establish a direct connection to the Ollama service. Firewall Settings: I've set up the necessary firewall rules on Google Cloud and ensured that the correct ports are open. Documentation and Research: I've reviewed the documentation regarding HTTPS support for the Ollama service but haven't found a definitive solution. I've searched forums and other resources but couldn't find a clear resolution. Preferred Solution: I've noticed that enabling HTTPS support for Ollama requires specific configurations, yet I haven't found a straightforward approach. Additional Information: Could any insights be shared regarding the server's current status, Ollama service configurations, or any hints related to HTTPS? I would appreciate your assistance. I need guidance or suggestions to move forward with this issue. Thank you.
Author
Owner

@pdevine commented on GitHub (Nov 30, 2023):

The easiest way to do this with a reverse proxy with a web server such as nginx. There are lots of tutorials online on how to do this, but I watched part of this one which seemed pretty straight forward: https://www.youtube.com/watch?v=DyXl4c2XN-o. Alternatively, since you're using Google Cloud, you can use their Cloud Load Balancing service to terminate TLS and potentially use it to load balance in front of multiple ollama instances.

Also, you should keep in mind that you want to restrict access to pushing/pulling models as this could lead to a DOS attack on your host. Since Ollama only services one request at a time, if you have a lot of clients which are trying to connect to it you could end up with not great performance unless you go the load balancer route.

<!-- gh-comment-id:1834624935 --> @pdevine commented on GitHub (Nov 30, 2023): The easiest way to do this with a reverse proxy with a web server such as nginx. There are lots of tutorials online on how to do this, but I watched part of this one which seemed pretty straight forward: https://www.youtube.com/watch?v=DyXl4c2XN-o. Alternatively, since you're using Google Cloud, you can use their Cloud Load Balancing service to terminate TLS and potentially use it to load balance in front of multiple ollama instances. Also, you should keep in mind that you want to restrict access to pushing/pulling models as this could lead to a DOS attack on your host. Since Ollama only services one request at a time, if you have a lot of clients which are trying to connect to it you could end up with not great performance unless you go the load balancer route.
Author
Owner

@technovangelist commented on GitHub (Dec 4, 2023):

It looks like Patrick has answered the question and you are good to go. So I will go ahead and close the now. If you think there is anything we left out, reopen and we can address. Thanks for being part of this great community.

<!-- gh-comment-id:1839577675 --> @technovangelist commented on GitHub (Dec 4, 2023): It looks like Patrick has answered the question and you are good to go. So I will go ahead and close the now. If you think there is anything we left out, reopen and we can address. Thanks for being part of this great community.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#685