I have developed a website in angular and have the following proxy settings in proxy.conf.js file.
const proxyConfig = [
{
context: '/web/api/webclients/**',
target: 'https://10.109.102.109',
changeOrigin: true,
secure: false
},
{
context: '/restful/**',
target: 'https://10.109.110.190',
changeOrigin: true,
secure: false
},
{
context: '/api/**',
target: 'http://10.109.105.107',
changeOrigin: true,
secure: false
}
];
The proxy.conf.js works as expected when in development mode.
I have these in the package.json file for start and build.
"build": "ng build --aot --prod",
"start": "ng serve --proxy-config proxy.conf.js -o",
After I run "npm run build" and use the resulted files to host the website on IIS 8, the pages that need to use the proxy settings do not work.
For example, my request https://localhost/web/api/webclients/authentication should go to https://10.109.102.109/web/api/webclients/authentication
How do I setup these proxy settings in IIS if I host this website on Windows server or how to setup these proxy settings if I host it on a non-windows server?