I created a project on Angular 6 and setup proxy.conf.json like this:
{
"/test-service": {
"target": "http://myhost:8080/test-service/",
"secure": true,
"pathRewrite": {
"^/test-service": ""
},
"logLevel": "debug",
"changeOrigin": true
}
}
And on my pc is running like charm. But when i do:
ng build --prod --optimization=false
And copy builded files to the server ( apache2 /var/www/html) the proxy pass is not working I tried to configure apache proxy pass :
ProxyPass /test-service/ http://localhost:8080/test-service/
ProxyPassReverse http://localhost:8080/test-service/ /test-service/
but still no luck.
Do i need to change some apache config or to somehow include proxy.conf.json to the build?
'test-service'path at the"target"field, so it proxies straight to your server athttp://myhost:8080proxy.confis not even included in the production build. Production builds require a different setup of configurations