How to build angular 4 apps in nginx or apache httpd? How to build angular 4 apps in nginx or apache httpd? nginx nginx

How to build angular 4 apps in nginx or apache httpd?


Angular apps are perfect candidates for serving with a simple static HTML server. You don't need a server-side engine to dynamically compose application pages because Angular does that on the client-side.

If the app uses the Angular router, you must configure the server to return the application's host page (index.html) when asked for a file that it does not have.

Suppose in your nginx server conf just add some thing like this. try_files $uri $uri/ /index.html;

Reference - https://github.com/auth0-samples/auth0-angular-samples/tree/master/02-User-Profile

Thank you JB Nizet, it worked finally.

server conf