How to add prefix to urls created by webpack for react app?

Viewed 13

I have deployed a react app which I can access at http://testserver.company.ac.in. I can acces the login page at http://testserver.company.ac.in/login. Now, our IT team has created a proxy pass so that I should be able to access the login page here: https://newserver.company.ac.in/extadm/login

It is able to load the html for login page:

<!doctype html>
<html lang="en">

<head>
    <meta charset="utf-8" />
    <link rel="icon" href="/favicon.ico" />
    <meta name="viewport" content="width=device-width,initial-scale=1" />
    <meta name="theme-color" content="#000000" />
    <meta name="description" content="Web site created using create-react-app" />
    <link rel="apple-touch-icon" href="/logo192.png" />
    <link rel="manifest" href="/manifest.json" />
    <title>React App</title>
    <script defer="defer" src="/static/js/main.22fa26e1.js"></script>
    <link href="/static/css/main.52d6b02d.css" rel="stylesheet">
</head>

<body><noscript>You need to enable JavaScript to run this app.</noscript>
    <div id="root"></div>
</body>

</html>

However, it showed white webpage. When I checked developer tools, I realized that it was not able to fetch main.js, main.css and manifest.json:

enter image description here

It seems that I need to configure webpack to add extadm before /static/js/main.22fa26e1.js, /static/css/main.52d6b02d.css and /manifest.json. How do I do it? Or is this some proxy related / server configuration issue?

0 Answers
Related