Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
ng serve with Apache + baseUrl gives 404 for included scripts #4211
Create new app with angular-cli.
The log given by the failure.
Server starts up fine:
Mention any other details that might be useful.
I have an Apache virtualhost proxy that forwards
When I access
I had this same setup with an Angular 1 app before and using BrowserSync. In that case I had to configure BrowserSync to serve requests to
However, I'm not sure how to do something similar with angular-cli or if it is possible. I would like to access my app from
Other things I tried
I tried adding in the
I also tried setting up a proxy even though I don't think this is the right path since I'm already kind of doing this through Apache. This was my proxy.conf.json:
When running with the proxy I would get an error in the browser either a bad gateway error or something that said it couldn't load that path.
@MTechDE Thanks for the suggestion. Unfortunately this doesn't work. I get the same error. I tried it along with the deployUrl property with same result.
I also read that this may not work with URLs more than one "folder" deep.
To summarize the steps I took:
This allows me to maintain my apache virtualhost proxies and to keep the same URL structure as is in my production environment.
@dhamotharan19, How are you running your app in production? In my case I run
This issue has been automatically locked due to inactivity.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.