-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
🌐 feat: Add support to SubDirectory hosting #9155
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
Great work! This is a must to have LibreChat behind a reverse proxy! |
Contributor
Author
|
@danny-avila updated, test fixed and linting issues reviewed 🙏🏼 |
|
I tested this on my side and it solves my use case: |
Contributor
Author
|
@danny-avila Merge conflict resolved. |
Contributor
Author
|
Hi @danny-avila, is there anything I can do to help streamline the process? |
danny-avila
approved these changes
Aug 27, 2025
Owner
Owner
|
This fixes it: danny:~/LibreChat$ git diff dev -- packages/data-provider/src/api-endpoints.ts
diff --git a/packages/data-provider/src/api-endpoints.ts b/packages/data-provider/src/api-endpoints.ts
index 59ede0905..8b6be0f5a 100644
--- a/packages/data-provider/src/api-endpoints.ts
+++ b/packages/data-provider/src/api-endpoints.ts
@@ -58,7 +58,7 @@ export const messages = (params: q.MessagesListParams) => {
return `${messagesRoot}/${conversationId}`;
}
- return `${messagesRoot}{buildQuery(rest)}`;
+ return `${messagesRoot}${buildQuery(rest)}`;
};
export const messagesArtifacts = (messageId: string) => `${messagesRoot}/artifacts/${messageId}`; |
5 tasks
danny-avila
added a commit
that referenced
this pull request
Aug 27, 2025
* feat: move buildTree function for message hierarchy to data provider * refactor: consolidate buildTree import from utils to data provider * fix: correct string interpolation in messages function, which caused message search requests to fail
Contributor
Author
|
Damn... Thank you for the quick fix! |
lihe8811
pushed a commit
to lihe8811/LibreChat
that referenced
this pull request
Aug 28, 2025
* feat: Add support to SubDirectory hosting * fix: address linting and failing test * fix: browser context validation --------- Co-authored-by: Danny Avila <[email protected]>
lihe8811
pushed a commit
to lihe8811/LibreChat
that referenced
this pull request
Aug 28, 2025
danny-avila#9312) * feat: move buildTree function for message hierarchy to data provider * refactor: consolidate buildTree import from utils to data provider * fix: correct string interpolation in messages function, which caused message search requests to fail
lihe8811
pushed a commit
to lihe8811/LibreChat
that referenced
this pull request
Aug 28, 2025
* feat: Add support to SubDirectory hosting * fix: address linting and failing test * fix: browser context validation --------- Co-authored-by: Danny Avila <[email protected]>
lihe8811
pushed a commit
to lihe8811/LibreChat
that referenced
this pull request
Aug 28, 2025
danny-avila#9312) * feat: move buildTree function for message hierarchy to data provider * refactor: consolidate buildTree import from utils to data provider * fix: correct string interpolation in messages function, which caused message search requests to fail
lihe8811
pushed a commit
to lihe8811/LibreChat
that referenced
this pull request
Aug 28, 2025
* feat: Add support to SubDirectory hosting * fix: address linting and failing test * fix: browser context validation --------- Co-authored-by: Danny Avila <[email protected]>
lihe8811
pushed a commit
to lihe8811/LibreChat
that referenced
this pull request
Aug 28, 2025
danny-avila#9312) * feat: move buildTree function for message hierarchy to data provider * refactor: consolidate buildTree import from utils to data provider * fix: correct string interpolation in messages function, which caused message search requests to fail
lihe8811
pushed a commit
to lihe8811/LibreChat
that referenced
this pull request
Aug 28, 2025
* feat: Add support to SubDirectory hosting * fix: address linting and failing test * fix: browser context validation --------- Co-authored-by: Danny Avila <[email protected]>
lihe8811
pushed a commit
to lihe8811/LibreChat
that referenced
this pull request
Aug 28, 2025
danny-avila#9312) * feat: move buildTree function for message hierarchy to data provider * refactor: consolidate buildTree import from utils to data provider * fix: correct string interpolation in messages function, which caused message search requests to fail
lihe8811
pushed a commit
to lihe8811/LibreChat
that referenced
this pull request
Aug 28, 2025
* feat: Add support to SubDirectory hosting * fix: address linting and failing test * fix: browser context validation --------- Co-authored-by: Danny Avila <[email protected]>
lihe8811
pushed a commit
to lihe8811/LibreChat
that referenced
this pull request
Aug 28, 2025
danny-avila#9312) * feat: move buildTree function for message hierarchy to data provider * refactor: consolidate buildTree import from utils to data provider * fix: correct string interpolation in messages function, which caused message search requests to fail
lihe8811
pushed a commit
to lihe8811/LibreChat
that referenced
this pull request
Aug 28, 2025
* feat: Add support to SubDirectory hosting * fix: address linting and failing test * fix: browser context validation --------- Co-authored-by: Danny Avila <[email protected]>
lihe8811
pushed a commit
to lihe8811/LibreChat
that referenced
this pull request
Aug 28, 2025
danny-avila#9312) * feat: move buildTree function for message hierarchy to data provider * refactor: consolidate buildTree import from utils to data provider * fix: correct string interpolation in messages function, which caused message search requests to fail
lihe8811
pushed a commit
to lihe8811/LibreChat
that referenced
this pull request
Aug 29, 2025
* feat: Add support to SubDirectory hosting * fix: address linting and failing test * fix: browser context validation --------- Co-authored-by: Danny Avila <[email protected]>
lihe8811
pushed a commit
to lihe8811/LibreChat
that referenced
this pull request
Aug 29, 2025
* feat: Add support to SubDirectory hosting * fix: address linting and failing test * fix: browser context validation --------- Co-authored-by: Danny Avila <[email protected]>
lihe8811
pushed a commit
to lihe8811/LibreChat
that referenced
this pull request
Aug 29, 2025
* feat: Add support to SubDirectory hosting * fix: address linting and failing test * fix: browser context validation --------- Co-authored-by: Danny Avila <[email protected]>
lihe8811
pushed a commit
to lihe8811/LibreChat
that referenced
this pull request
Aug 29, 2025
* feat: Add support to SubDirectory hosting * fix: address linting and failing test * fix: browser context validation --------- Co-authored-by: Danny Avila <[email protected]>
lihe8811
pushed a commit
to lihe8811/LibreChat
that referenced
this pull request
Aug 29, 2025
* feat: Add support to SubDirectory hosting * fix: address linting and failing test * fix: browser context validation --------- Co-authored-by: Danny Avila <[email protected]>
lihe8811
pushed a commit
to lihe8811/LibreChat
that referenced
this pull request
Aug 29, 2025
danny-avila#9312) * feat: move buildTree function for message hierarchy to data provider * refactor: consolidate buildTree import from utils to data provider * fix: correct string interpolation in messages function, which caused message search requests to fail
lihe8811
pushed a commit
to lihe8811/LibreChat
that referenced
this pull request
Sep 4, 2025
* feat: Add support to SubDirectory hosting * fix: address linting and failing test * fix: browser context validation --------- Co-authored-by: Danny Avila <[email protected]>
lihe8811
pushed a commit
to lihe8811/LibreChat
that referenced
this pull request
Sep 4, 2025
danny-avila#9312) * feat: move buildTree function for message hierarchy to data provider * refactor: consolidate buildTree import from utils to data provider * fix: correct string interpolation in messages function, which caused message search requests to fail
pedrojreis
pushed a commit
to nosportugal/LibreChat
that referenced
this pull request
Sep 4, 2025
* feat: Add support to SubDirectory hosting * fix: address linting and failing test * fix: browser context validation --------- Co-authored-by: Danny Avila <[email protected]>
pedrojreis
pushed a commit
to nosportugal/LibreChat
that referenced
this pull request
Sep 4, 2025
danny-avila#9312) * feat: move buildTree function for message hierarchy to data provider * refactor: consolidate buildTree import from utils to data provider * fix: correct string interpolation in messages function, which caused message search requests to fail
Closed
1 task
arbreton
pushed a commit
to arbreton/LibreChat
that referenced
this pull request
Oct 9, 2025
* feat: Add support to SubDirectory hosting * fix: address linting and failing test * fix: browser context validation --------- Co-authored-by: Danny Avila <[email protected]>
arbreton
pushed a commit
to arbreton/LibreChat
that referenced
this pull request
Oct 9, 2025
danny-avila#9312) * feat: move buildTree function for message hierarchy to data provider * refactor: consolidate buildTree import from utils to data provider * fix: correct string interpolation in messages function, which caused message search requests to fail
7 tasks
Guiraud
pushed a commit
to Guiraud/LibreChat
that referenced
this pull request
Nov 21, 2025
* feat: Add support to SubDirectory hosting * fix: address linting and failing test * fix: browser context validation --------- Co-authored-by: Danny Avila <[email protected]>
Guiraud
pushed a commit
to Guiraud/LibreChat
that referenced
this pull request
Nov 21, 2025
danny-avila#9312) * feat: move buildTree function for message hierarchy to data provider * refactor: consolidate buildTree import from utils to data provider * fix: correct string interpolation in messages function, which caused message search requests to fail
patricksn3ll
pushed a commit
to patricksn3ll/LibreChat
that referenced
this pull request
Dec 11, 2025
* feat: Add support to SubDirectory hosting * fix: address linting and failing test * fix: browser context validation --------- Co-authored-by: Danny Avila <[email protected]>
patricksn3ll
pushed a commit
to patricksn3ll/LibreChat
that referenced
this pull request
Dec 11, 2025
danny-avila#9312) * feat: move buildTree function for message hierarchy to data provider * refactor: consolidate buildTree import from utils to data provider * fix: correct string interpolation in messages function, which caused message search requests to fail
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🌐 feat: Add support to SubDirectory hosting
Summary
The changes in this Pull Request implement the Enhancement Request described in #1701.
With this changes LibreChat can now be hosted in a subdirectory or path.
I've implemented this change reusing the DOMAIN_CLIENT and DOMAIN_SERVER environment variables, which I assume was the original idea of the author. Thus I've not made any documentation change. If DOMAIN_CLIENT is set with a URL that includes a path, then the system will adapt itself to it.
Change Type
Please delete any irrelevant options.
Testing
I've setup a reverse proxy in front of the LibreChat image, redirecting the traffic of "/mycustomaddress" to port 3080. The setup was made using the strip-prefix middleware, to ensure the requests reach port 3080 already without the "/mycustomaddress" part of the URL.
Test Configuration:
LibreChat relevant env vars:
Traefik configuration file:
Checklist