When you integrate angular2 with laravel on top of nginx, you may see empty page while accessing angular2 end point on browser.

say http://server-ip/angularclient

if you dig little deeper using inspect element, you may see 404 for all files(css,html,js,etc).

You just need to verify the href base is as same as nginx routing path.

nginx config for angular2 would look like:

location /angularclient/ {
proxy_pass http://127.0.0.1:4200/;
}

 

However in angular2 index.html file,  href should be like:

<base href="/angularclient/">


Leave a Reply