antonybudianto / angular-starter

:star: Gulp Angular Starter using TypeScript (Updated to 4.4.3)

Home Page:https://antonybudianto.github.io/angular-starter/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problem with deploy the build folder on nginx

clairekh opened this issue · comments

## Issue Overview

<Please explain the issue overview here, short but concise and to-the-point>
I have problem with deploy the build folder (generated by npm run build) on nginx.
Application url: http://localhost/angular2-starter/
I have errors:
"NetworkError: 404 Not Found - http://localhost/assets/bundle-e5a31ad078.css"
"NetworkError: 404 Not Found - http://localhost/assets/lib-e417833ab8.js"
"NetworkError: 404 Not Found - http://localhost/assets/app-2bb2880752.js"

Issue Description

After that I edited base href in **index.html** to `` and did new deploy. Now application is starting. But if I want go to second level page directly like [Todolist](http://localhost/angular2-starter/todolist), I have error: `"NetworkError: 404 Not Found - http://localhost/angular2-starter/todolist"` ## Reproducables

<Please explain the way to reproduce your issue, or even better with Plunker link>
It is produced after deploy the build folder on web server.

The same situation in demo version. Please, go here.

Information

Operating System Ubuntu
Node version 6.6.0
NPM Version 3.10.3
Environment Chrome / Mozilla Firefox

My demo used Github page which currently don't support redirection (unlike Firebase hosting), I'll consider moving soon.

You need to configure your nginx/any web server to redirect all to index.html and Angular router will handle the rest.
This may help https://stackoverflow.com/questions/7027636/nginx-send-all-requests-to-a-single-html-page
So this is not the starter issue, but the server/hosting issue.