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

[FIX] Bad Request (400) running in docker #745

Open
3 of 14 tasks
techieanant opened this issue May 23, 2024 · 2 comments
Open
3 of 14 tasks

[FIX] Bad Request (400) running in docker #745

techieanant opened this issue May 23, 2024 · 2 comments
Labels
fix Fix something that isn't working as expected

Comments

@techieanant
Copy link

techieanant commented May 23, 2024

Describe the bug

I'm running Khoj docker compose stack on a server on my local network, have all the env variables setup but visiting /server/admin route throws a 400 Bad Request error. The logs show the following error:

 DisallowedHost: Invalid HTTP_HOST                    

 header: '10.0.0.197:42110'. You may                  

 need to add '10.0.0.197' to                          

 ALLOWED_HOSTS.

There seems to be no way to add a environment variable for setting allowed hosts.

To Reproduce

Steps to reproduce the behavior:

  • Run Khoj docker compose stack on a server on your network
  • Try to visit the admin route and see error

Screenshots

image

Platform

  • Server:
    • Cloud-Hosted (https://app.khoj.dev)
    • Self-Hosted Docker
    • Self-Hosted Python package
    • Self-Hosted source code
  • Client:
    • Obsidian
    • Emacs
    • Desktop app
    • Web browser
    • WhatsApp
  • OS:
    • Windows
    • macOS
    • Linux
    • Android
    • iOS

If self-hosted

  • Server Version [e.g. 1.0.1]: 1.12

Additional context

Add any other context about the problem here.

@techieanant techieanant added the fix Fix something that isn't working as expected label May 23, 2024
@sabaimran
Copy link
Collaborator

Hey @techieanant , I'm assuming you can't access it over localhost?

You must have used the docker-compose.yml sample file to scaffold you Khoj instance. You can use that to set the environment variable KHOJ_DOMAIN. There are some notes about that here: https://docs.khoj.dev/get-started/setup/#setup-notes.

@techieanant
Copy link
Author

Thank you that worked although I now see a different problem.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Fix something that isn't working as expected
Projects
None yet
Development

No branches or pull requests

2 participants