NG Build--base-href Setup problem

Source: Internet
Author: User

Issues encountered in the project build deployment:

1. Do not use hash, how to solve the problem of refreshing page 404?

Description

root specifies the project address path, which defaults to the HTML under Nginx

Index default Access Index file

Try_files here is actually changed by if, meaning that if the URI exists, then access the URI resource, if the URI does not exist, then access to the directory of the index.html file, thereby resolving the Refresh page 404 error.

2. Two-layer file path Refresh with resource load error issues

Premise: When building the project, use NG build--base-href./success, but when deploying the server side (using Nginx), the following problems occur:

Visible, redundant records layer path, so there is a problem with the path, change the following:

Build with NG build--base-href/Package project, or direct NG build because the default is/path, you can view the index.html file:

Deploy, find problem solving, done!

NG Build--base-href Setup problem

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.