Ollama Connection Issues โ
Connection issues can be caused by a number of reasons. Here are some common issues and how to resolve them on Page Assist. You will see the following error message if there is a connection issue:
1. Direct Connection Error โ
2. 403
Error When Sending a Message โ
This issue because of CORS (Cross-Origin Resource Sharing) issues. Since Page Assist is a browser extension, it needs to communicate with the server through the browser. However, the browser restricts communication between different origins. To resolve this issue, you can try the following solutions:
1. Solutions โ
Since Ollama has connection issues when directly accessed from the browser extension, Page Assist rewrites the request headers to make it work. However, automatic rewriting of headers only works on http://127.0.0.1:*
and http://localhost:*
URLs. To resolve the connection issue, you can try the following solutions:
Go to Page Assist and click on the
Settings
icon.Click on the
Ollama Settings
tab.There you will see the
Advance Ollama URL Configuration
option. You need to expand it.
- Enable the
Enable or Disable Custom Origin URL
option.
TIP
If Ollama is running on a different port, then change the URL in the Custom Origin URL
field; otherwise, leave it as it is. Do not change the URL to the Ollama server URL like
- Make sure click on the
Save
button to save the changes.
This will resolve the connection issue, and you will be able to use Ollama without any issues on Page Assist
2. Solution โ
You can set OLLAMA_ORIGIN=* to allow connections from any origin. Here's how to do it on different operating systems:
Windows โ
- Open Start menu and search for "Environment Variables"
- Click "Edit the system environment variables"
- Click "Environment Variables" button
- Under "System Variables" click "New"
- Set Variable name:
OLLAMA_ORIGIN
and Variable value:*
- Click OK to save
- Restart Ollama service
MacOS โ
- Open Terminal
- Run the following command:
launchctl setenv OLLAMA_ORIGIN "*"
- Restart Ollama service
Linux โ
- Open Terminal
- Run the following command:
export OLLAMA_ORIGIN="*"
- Restart Ollama service
This will allow connections from any origin. Hopefully, this will resolve the connection issue.
If you still face any issues, feel free to contact us here, and we will be happy to help you out.