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

Feature request: support operation behind a proxy #915

Open
tokarenko opened this issue Feb 14, 2025 · 4 comments
Open

Feature request: support operation behind a proxy #915

tokarenko opened this issue Feb 14, 2025 · 4 comments

Comments

@tokarenko
Copy link

I suggest to support Zoekt operation behind a proxy by adding configurable base_url parameter as a prefix to lines 193-L197 of server.go:

	if s.HTML {
		mux.HandleFunc("/robots.txt", s.serveRobots)
		mux.HandleFunc("/search", s.serveSearch)
		mux.HandleFunc("/", s.serveSearchBox)
		mux.HandleFunc("/about", s.serveAbout)
		mux.HandleFunc("/print", s.servePrint)
	}
Copy link

linear bot commented Feb 14, 2025

@jtibshirani
Copy link
Member

hello @tokarenko! At first glance, it feels like these endpoints should already work with a proxy. Is there a specific issue you're running into? (Just checking I understand the problem, to ensure we're making the right code change.)

@tokarenko
Copy link
Author

We were unable to get Zoekt GUI working behind the nginx without prefixing the lines above. We tried to make Zoekt GUI accessible by …/zoekt/ URL. Without the base URL prefix all the links break as lead to a site root URL.

@jtibshirani
Copy link
Member

I just checked with my team about how we serve this webserver GUI behind a proxy. Everything works well without any changes to Zoekt. Here's how we set up the proxy in Sourcegraph: https://sourcegraph.com/github.com/sourcegraph/sourcegraph-public-snapshot/-/blob/cmd/frontend/internal/app/debugproxies/handler.go?L38-41

nginx can have surprising behavior around trailing backslashes, it's worth double-checking your config looks roughly like this:

        location /zoekt/ {
            proxy_pass http://localhost:6070/;
        }

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

No branches or pull requests

2 participants