You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
About access unstract web from other computer #414
Hi @haluwong ,
I think below can help you with setting it up for a different domain.
You actually don't need to use nginx. We are using traefik already in our docker-compose. So you can continue using this. We just need to make changes to the hosts in routing rules and backend envs.
To change routing rules you need to change the host name from frontend.unstract.localhost to which even hostname you want to use.
(In local should be changing the backend/.env file. If you are making change in backend/sample.env file then you need to delete the backend/.env file if it already exists and then run the script)
This should be enough to get it running for a different host.
Please try and let us know if it works for you.
Also if possible it would be great if you can help with a new README on how to setup unstract for different host.
I modified the host configuration in sample.proxy_overrides.yaml, but it still prompts that verification cannot be performed when logging in, and jumps back to the landing page.
@dumbsheep1990 Hi can you confirm if the changes where made in backend/sample.env as mentioned in the below thread. If you have could you please share the screenshots or share the configuration itself of backend?
Hi @haluwong , I think below can help you with setting it up for a different domain.
You actually don't need to use nginx. We are using traefik already in our docker-compose. So you can continue using this. We just need to make changes to the hosts in routing rules and backend envs.
To change routing rules you need to change the host name from frontend.unstract.localhost to which even hostname you want to use.
@ritwik-g I tried to following your suggestion to modify .env and labels for unstract-backend and unstract-frontend
also, modified the backend/settings/dev.py in unstract-backend
added our URL in the
CORS_ALLOWED_ORIGINS
CORS_ORIGIN_WHITELIST
@haluwong , when you modified the code (backend/settings/dev.py), you will need to build containers from the local code. Which is acheivable passing -b or --build-local to ./run-platform.sh
Hope you have done this.
In any case I don't think this is a CORS error. Can you also share
Response of this network call?
And also check if any specific error log in the backend?
I downloaded the latest branch.
Try to replace all the "frontend.unstract.localhost" to my desired hostname.
use "./run-platform.sh -b" to build it locally and run it.
Login page can show but will show NetworkError to fetch the source map
@haluwong I think the issue is with traefik routing. From the response of login API(/api/v1/login) it looks like to be going to Frontend container instead of backend.
Can you share the screenshot of docker-compose.yaml portions for backend and front-end?
@haluwong I tried this locally and noticed one thing. If you make change in sample.env file in backend then we need to delete the backend/.env file and run the script again. Else the .env file is not updated.
So either delete backend/.env file and run script or make the changes directly in .env file it should work for you
If I run all services on my desktop, there are no issues and I can access and use the system.
If I run all services on my server and want to access it from other devices within the same network, there are issues.
Host On Server & Access On Desktop:
Git clone of latest (0.83.0) and run with no changes, I could access the front page and get to api/v1/login
[Issue] On form submit it redirects to /landing
Adding desktop IP to CORS_ALLOWED_ORIGINS and CORS_ORIGIN_WHITELIST, clean docker images and rebuild
[Issue] On form submit it redirects to /landing
Setting SESSION_COOKIE_SECURE to False, clean docker images and rebuild
[Issue] System goes into a redirect loop between /onboarding and /landing with PermissionDenied('CSRF Failed: CSRF cookie not set.') and Forbidden: /api/v1/organization/mock_org/set
This looks like to be the major problem. If anyone tries to run it in HTTP mode it might not work due to this config. @hari-kuriakose since our OSS version by default runs in HTTP mode I will try to make some changes with this and raise a PR. We might need to update the document as well
This issue of hardcoding the inter-dependent URLs makes the whole stack unusable in a realistic open-source setting, and it seems to be pushing us to use the cloud version only.
@dumbsheep1990 Hi can you confirm if the changes where made in backend/sample.env as mentioned in the below thread. If you have could you please share the screenshots or share the configuration itself of backend?
Hi @haluwong , I think below can help you with setting it up for a different domain.
You actually don't need to use nginx. We are using traefik already in our docker-compose. So you can continue using this. We just need to make changes to the hosts in routing rules and backend envs.
To change routing rules you need to change the host name from frontend.unstract.localhost to which even hostname you want to use.
[unstract/docker/docker-compose.yaml](https://github.com/Zipstack/unstract/blob/49b9873a7a3feca769919fe2ce8846c743c187fd/docker/docker-compose.yaml#L31)
Line 31
in
[49b9873](/Zipstack/unstract/commit/49b9873a7a3feca769919fe2ce8846c743c187fd)
- traefik.http.routers.backend.rule=Host(`frontend.unstract.localhost`) && PathPrefix(`/api/v1`, `/deployment`)
[unstract/docker/docker-compose.yaml](https://github.com/Zipstack/unstract/blob/49b9873a7a3feca769919fe2ce8846c743c187fd/docker/docker-compose.yaml#L105)
Line 105
in
[49b9873](/Zipstack/unstract/commit/49b9873a7a3feca769919fe2ce8846c743c187fd)
- traefik.http.routers.frontend.rule=Host(`frontend.unstract.localhost`)
Should change envs in backend related to the FE URL.
[unstract/backend/sample.env](https://github.com/Zipstack/unstract/blob/49b9873a7a3feca769919fe2ce8846c743c187fd/backend/sample.env#L10)
Line 10
in
[49b9873](/Zipstack/unstract/commit/49b9873a7a3feca769919fe2ce8846c743c187fd)
DJANGO_APP_BACKEND_URL=http://frontend.unstract.localhost
[unstract/backend/sample.env](https://github.com/Zipstack/unstract/blob/49b9873a7a3feca769919fe2ce8846c743c187fd/backend/sample.env#L35-L38)
Lines 35 to 38
in
[49b9873](/Zipstack/unstract/commit/49b9873a7a3feca769919fe2ce8846c743c187fd)
LOGIN_NEXT_URL="http://frontend.unstract.localhost/org"
LANDING_URL="http://frontend.unstract.localhost/landing"
ERROR_URL="http://frontend.unstract.localhost/error"
WEB_APP_ORIGIN_URL="http://frontend.unstract.localhost"
This should be enough to get it running for a different host.
Please try and let us know if it works for you.
Also if possible it would be great if you can help with a new README on how to setup unstract for different host.
When I try that, and then run docker compose to recreate the containers, I get "unable to get image 'unstract/backend:': Error response from daemon: invalid reference format". (This does not happen, if I re-run ./run-platform.sh.)
Activity
ritwik-g commentedon Jun 21, 2024
Hi @haluwong ,
I think below can help you with setting it up for a different domain.
frontend.unstract.localhostto which even hostname you want to use.unstract/docker/docker-compose.yaml
Line 31 in 49b9873
unstract/docker/docker-compose.yaml
Line 105 in 49b9873
unstract/backend/sample.env
Line 10 in 49b9873
unstract/backend/sample.env
Lines 35 to 38 in 49b9873
backend/.envfile. If you are making change inbackend/sample.envfile then you need to delete thebackend/.envfile if it already exists and then run the script)This should be enough to get it running for a different host.
Please try and let us know if it works for you.
Also if possible it would be great if you can help with a new README on how to setup unstract for different host.
dumbsheep1990 commentedon Jun 22, 2024
I modified the corresponding points according to the prompts. The homepage can be accessed, but after logging in, it still jumps to http://frontend.unstract.localhost.
dumbsheep1990 commentedon Jun 22, 2024
I modified the host configuration in sample.proxy_overrides.yaml, but it still prompts that verification cannot be performed when logging in, and jumps back to the landing page.
ritwik-g commentedon Jun 24, 2024
@dumbsheep1990 Hi can you confirm if the changes where made in
backend/sample.envas mentioned in the below thread. If you have could you please share the screenshots or share the configuration itself of backend?haluwong commentedon Jun 24, 2024
@ritwik-g I tried to following your suggestion to modify .env and labels for unstract-backend and unstract-frontend
also, modified the backend/settings/dev.py in unstract-backend
added our URL in the
CORS_ALLOWED_ORIGINS
CORS_ORIGIN_WHITELIST
Can show the login page but cannot login.

http://unstract.certosa.com/api/v1/session (401 authorized)
ritwik-g commentedon Jun 24, 2024
@haluwong , when you modified the code (backend/settings/dev.py), you will need to build containers from the local code. Which is acheivable passing

-bor--build-localto./run-platform.shHope you have done this.
In any case I don't think this is a CORS error. Can you also share
haluwong commentedon Jun 26, 2024
I downloaded the latest branch.
Try to replace all the "frontend.unstract.localhost" to my desired hostname.
use "./run-platform.sh -b" to build it locally and run it.
Login page can show but will show NetworkError to fetch the source map

But i can access http://unstract.certosa.com/static/js/main.12ab8275.js.map in my browser.
Then, click login and input the username ,password and login and then it will redirect to first login page again.

some js show NetworkError too but I can access it.

And for http://unstract.certosa.com/api/v1/login
Request:
Response:

I tried in both chrome and firefox

redirect to the following landing page after login~
Hope this information is useful for your troubleshooting
ritwik-g commentedon Jun 30, 2024
@haluwong I think the issue is with traefik routing. From the response of login API(/api/v1/login) it looks like to be going to Frontend container instead of backend.
Can you share the screenshot of
docker-compose.yamlportions for backend and front-end?ritwik-g commentedon Jul 3, 2024
@haluwong I tried this locally and noticed one thing. If you make change in
sample.envfile in backend then we need to delete thebackend/.envfile and run the script again. Else the.envfile is not updated.So either delete
backend/.envfile and run script or make the changes directly in.envfile it should work for you5 remaining items
dmnxprss commentedon Aug 25, 2024
I have noticed a similar issue with this.
Host On Server & Access On Desktop:
api/v1/login[Issue] On form submit it redirects to
/landingCORS_ALLOWED_ORIGINSandCORS_ORIGIN_WHITELIST, clean docker images and rebuild[Issue] On form submit it redirects to
/landingSESSION_COOKIE_SECUREtoFalse, clean docker images and rebuild[Issue] System goes into a redirect loop between
/onboardingand/landingwithPermissionDenied('CSRF Failed: CSRF cookie not set.')andForbidden: /api/v1/organization/mock_org/setCan you provide any advice?
ashok-log commentedon Sep 2, 2024
I too am getting an error when I try accessing remotely. Network trace is given below:
dmnxprss commentedon Sep 12, 2024
After some Docker & DNS work, I was able to resolve this.
Stack is currently running on local server, accessible within network.
alancamillo commentedon Sep 16, 2024
Could you share more detail about it, please?
theclash12072002 commentedon Oct 7, 2024
Hi @dmnxprss , could you give us more details, please?
ritwik-g commentedon Oct 10, 2024
unstract/backend/backend/settings/base.py
Lines 89 to 90 in 7a8e2e4
This looks like to be the major problem. If anyone tries to run it in HTTP mode it might not work due to this config. @hari-kuriakose since our OSS version by default runs in HTTP mode I will try to make some changes with this and raise a PR. We might need to update the document as well
hari-kuriakose commentedon Oct 10, 2024
@ritwik-g Agree, they could be
Falseby default and could be set explicitly as per the deployment env.cc @muhammad-ali-e @johnyrahul @athul-rs
balajipitchumani commentedon Dec 20, 2024
This issue of hardcoding the inter-dependent URLs makes the whole stack unusable in a realistic open-source setting, and it seems to be pushing us to use the cloud version only.
luoyezadi commentedon Feb 25, 2025
@dmnxprss
Could you please elaborate on that? Thank you very much.
gitwittidbit commentedon Jun 17, 2025
When I try that, and then run docker compose to recreate the containers, I get "unable to get image 'unstract/backend:': Error response from daemon: invalid reference format". (This does not happen, if I re-run ./run-platform.sh.)
What might be the issue?
Thanks
ljohnso16 commentedon Feb 19, 2026
it took some tinkering but i was able to use the docs to get this on my server. Its working for now. with openAI, the n8n node works well with it.