zoukankan      html  css  js  c++  java
  • 「ng」生产版本部署,404 Not Found问题

    【问题】

    使用nginx服务,使用 ng build --prod 后生成dist目录,在nginx.conf配置中指向dist后发现除了首页正常,其他都是404 Not Found

    【解决】

    其实官网已有解答,增加映射即可,参考我的nginx.conf的配置文件

    server {
            listen       80;
            server_name  127.0.0.1;
            location / {
                root         /home/workspace/mysite/mysite-ui/dist/mysite-ui;
                try_files $uri $uri/ /index.html;
            }

            # Load configuration files for the default server block.
            #include /etc/nginx/default.d/*.conf;

            error_page 404 /404.html;
                location = /40x.html {
            }

            error_page 500 502 503 504 /50x.html;
                location = /50x.html {
            }
        }

  • 相关阅读:
    事务和异常处理
    普通三层结构示例
    Viewstate与Static
    oracle 9i 的数据类型
    XSD数据集
    ASP.NET中的错误处理和程序优化
    PL/SQL程序设计
    ASP.NET 2.0中的异步页面
    Oracle中RowNum的用法
    .NET单元测试
  • 原文地址:https://www.cnblogs.com/ftrako/p/10234268.html
Copyright © 2011-2022 走看看