lukenc opened a new issue, #9791:
URL: https://github.com/apache/skywalking/issues/9791

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/skywalking/issues?q=is%3Aissue) and found no 
similar issues.
   
   
   ### Apache SkyWalking Component
   
   UI (apache/skywalking-booster-ui)
   
   ### What happened
   
   if i want to access the web by nginx's prefix mode, js file will not with 
the prefix path.
   
   nginx config just like this
   
   `    location ^~/trace/ {
             charset UTF-8;
             proxy_pass http://trace-service/;
         }`
   
   then js will be 404.
   and it is a white page ,nothing in it
   because the prefix /trace.
   
   
   
   ### What you expected to happen
   
   solution:
   
   in `skywalking-ui/src/router/index.ts`:
   
   `createWebHistory` change to  `createWebHashHistory`
   
   this edit for request `/graphql` :
   
   in `skywalking-ui/src/graphql/fetch.ts`:
   ```
     const res: AxiosResponse = await axios.post(
       "/trace/graphql",
       { query: param.queryStr, variables: { ...param.conditions } },
       { cancelToken: cancelToken() }
     );
   ```
   
   will be like this:
   
   ```
   await axios.post(
      **window.location.pathname+** "/graphql",
       { query: param.queryStr, variables: { ...param.conditions } },
       { cancelToken: cancelToken() }
     );
   ```
   
   and in `skywalking-ui/src/graphql/index.ts`:
   
   same like this
   
   ```
   axios
         .post(
           **window.location.pathname+**"/graphql",
           {
             query: query[this.queryData],
             variables: variablesData,
           },
           { cancelToken: cancelToken() }
         )
   ```
   
   
   next load js is another matter:
   
   pls add   
   
   `publicPath: "./",`
   
   to `module.exports`
   
   like this 
   ```
   module.exports = {
     outputDir: "dist",
     productionSourceMap: false,
     **publicPath: "./",**
     devServer: {
   ...........
   ```
   
   
   and now it works .
   
   ### How to reproduce
   
   1: use nginx match prefix mode.
   
   2: just do like the quick start
   
   it will reproduce
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: 
[email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to