Skip to content

Commit

Permalink
[Dashboard][Bug fix] When using an nginx proxy, the front-end may mis…
Browse files Browse the repository at this point in the history
…spell the URL when accessing the log. (ray-project#34130)

In our use case, we need to access the dashboard in the online cluster through an nginx proxy from the intranet. We found that when accessing the log page under this scenario, the front-end would misspell the URL, resulting in a failure to load.
## Related issue number

Closes ray-project#34043

Signed-off-by: Jack He <[email protected]>
  • Loading branch information
Catch-Bull authored and ProjectsByJackHe committed May 4, 2023
1 parent d5739fd commit 2395e76
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions dashboard/client/src/service/log.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
import { get } from "./requestHandlers";

const getLogUrl = (url: string) => {
if (window.location.pathname !== "/" && url !== "log_index") {
const pathArr = window.location.pathname.split("/");
if (pathArr.length > 1) {
const idx = pathArr.findIndex((e) => e.includes(":"));
if (idx > -1) {
const afterArr = pathArr.slice(0, idx);
afterArr.push(url.replace(/https?:\/\//, ""));
url = afterArr.join("/");
}
}
}
return url === "log_index" ? url : `log_proxy?url=${encodeURIComponent(url)}`;
};

Expand Down

0 comments on commit 2395e76

Please sign in to comment.