Open dadlerj opened 6 years ago
Another user has requested this here: https://stackoverflow.com/questions/51223293/nginx-reverse-proxy-subdirectory-rewrites-for-sourcegraph
is there any progress for this issue? I desperately need this feature.
@alexandnpu thanks for the feedback. This is not yet supported. However, we've moved external URL configuration to nginx, which brings us fairly close: https://github.com/sourcegraph/sourcegraph/blob/master/doc/admin/nginx.md. The final step would be to ensure that all frontend AJAX requests and URLs use relative paths, rather than absolute paths (as absolute paths would conflict with the subpath setup).
At the moment, we're backlogged with other priorities, so I can't offer a concrete timeline beyond saying this is on our radar and we will revisit this every month when we do prioritization. We prioritize features based on customer needs and our product roadmap. We also accept open-source PRs if you'd be open to submitting one!
@beyang , thanks for you feedback and sorry for my late reply.
IMHO, I think subdirectories supporting IS the top priority. If users cannot setup sourcegraph, they cannot use it, not to speak of using your advanced features.
@alexandnpu Can you help me understand the need for a subdirectory? What prevents you from running Sourcegraph on its own hostname?
In my company, it is not very convenient to apply a new domain name, so every team has only one internal domain name, like below:
if we have to setup our own web tools, the only way we have to do is to use subdirectories under our team domain name. For example, I successfully setup grafana in team1.example.com/grafana
with the following simple nginx setup (where I run grafana within docker):
location /grafana/ {
proxy_pass http://grafana_servers/;
}
I did some investigation with sourcegraph why it doesnot work with subdirectory in nginx. it turns out to be like what @beyang said above, the frontend ignores the path i setup, the frontend uses only the domain name, not including the subdirectory.
@alexandnpu Got it, thank you. That is helpful to understand. There are other issues we'd need to investigate before making this change, such as cookie hosts and CORS policies, and future product plans around using subdomains (such as myorg.gitlab.io or myorg.github.io for GitLab/GitHub Pages-like features). We generally prioritize customer requests, so if you are at a current customer or plan to be, let me know. Otherwise, we accept PRs and we'll keep this issue updated. Thanks!
Well it seems this didn't evolve since 2021. Im trying to figure out how to configure sourcegraph to be reachable from https://www.externalurl.foobar/sourcegraph.
This kind of feature is very basic and almost found in most of web application. Also, in the documentation, this limitation must be written and clear. So that peoples like me dont try to install it at my clients request and facing a major issue due to my clients environment constraints.
Describe the feature request.
A customer requested support for
externalURL
config values (https://about.sourcegraph.com/docs/config/site) that include subdirectories.Is your feature request related to a problem? Please describe.
As the customer described it:
Describe alternatives you've considered.
n/a
Additional context
More context from the user:
Requested by: