Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add nginx so we can bypass the cors error #6

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

sbe-arg
Copy link

@sbe-arg sbe-arg commented Mar 25, 2024

Bumped a few dependencies.
Adds nginx with an example so it can run cross hosts.
Adds dependabot

@sbe-arg sbe-arg changed the title feat: add nginx so we can bypass the corss error feat: add nginx so we can bypass the cors error Mar 25, 2024
@Dhruvgera
Copy link
Collaborator

I don't think this is needed any longer, editing .env from localai-backend to set the cors props directly fixes the issue

@sbe-arg
Copy link
Author

sbe-arg commented Apr 11, 2024

Its not just a cors problem is a cross host set this allows to have local ai and this container in 2 different machines/server

I tried many ways to make this work cross host and nothing worked without nginx

Can you add a working example?

@Dhruvgera
Copy link
Collaborator

Its not just a cors problem is a cross host set this allows to have local ai and this container in 2 different machines/server

I tried many ways to make this work cross host and nothing worked without nginx

Can you add a working example?

I just tested it today, all you've to do is when hosting LocalAI, go to .env, uncomment the cors and galleries variables. That will fix the issue

@bioshazard
Copy link

LOCALAI_GALLERIES=[{"name":"model-gallery", "url":"github:go-skynet/model-gallery/index.yaml"}]

# CORS settings
LOCALAI_CORS=true
LOCALAI_CORS_ALLOW_ORIGINS=*

This did not fix it for me. Might be PEBKAC, but no way in logs with debug on to verify that setting. I know that's a LocalAI issue rather than with this repo, but I figured to mention others are running into this problem.

@Dhruvgera
Copy link
Collaborator

LOCALAI_GALLERIES=[{"name":"model-gallery", "url":"github:go-skynet/model-gallery/index.yaml"}]

# CORS settings
LOCALAI_CORS=true
LOCALAI_CORS_ALLOW_ORIGINS=*

This did not fix it for me. Might be PEBKAC, but no way in logs with debug on to verify that setting. I know that's a LocalAI issue rather than with this repo, but I figured to mention others are running into this problem.

I'm unable to reproduce this issue, hence my reluctance towards adding unnecessary docker images. If more users report of this, I'll add in nginx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants