首页 > 解决方案 > 为什么我在使用 Nginx 设置 Angular 应用程序时得到 404

问题描述

我正在尝试使用 nginx 设置一个角度应用程序。这是我的 nginx 配置文件:

server {
listen              4300;
server_name         localhost;


location / {
    root /root/sultana/thumbs;
    try_files $uri no-img.png;
}
location /dashboard {
    root /srv/www/htdocs;
    index index.html index.htm;
}
}

第一个位置仅提供图像并按预期工作。请求由 HAProxy 转发。当我导航到 /dashboardLogin 时,我得到 404。

标签: angularnginxhttp-status-code-404

解决方案


推荐阅读