userhimanshuverma opened a new pull request, #15596:
URL: https://github.com/apache/pinot/pull/15596

   [PINOT-17](https://issues.apache.org/jira/browse/PINOT-17)
   
   **Problem:**  
   When Apache Pinot is deployed behind an Apache Knox Gateway, the frontend 
fails to correctly resolve API endpoints. This is due to the hardcoded 
`baseURL: '/'` in the Axios configuration, which assumes Pinot is always served 
from the root context. However, Knox typically proxies services under custom 
paths (e.g., `/gateway/default/pinot`), causing API requests to misroute and 
fail.
   
   **Root Cause:**  
   The hardcoded root path (`'/'`) used as the base URL in Axios does not 
account for the dynamic sub-path under which Pinot may be served when proxied 
by Knox. As a result, the browser attempts to make API calls to incorrect or 
non-existent paths.
   
   **Solution:**  
   Updated the Axios `baseURL` configuration to use `location.pathname` instead 
of a static `'/'`. This change ensures that API calls are relative to the 
current path under which Pinot is loaded. It makes the frontend dynamically 
adapt to any sub-path — including those added by Knox or other reverse proxies 
— without breaking API routing.
   
   **Code Change:**  
   ```ts
   export const baseApi = axios.create({ baseURL: location.pathname });
   ```
   
   **Impact:**  
   - Fixes Pinot UI accessibility when deployed behind Knox Gateway.
   - Maintains existing functionality for standalone/non-Knox deployments.
   - Ensures compatibility across different proxy configurations.
   
   


-- 
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: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to