angular2 universal和nginx不能很好地协同工作

angular2 universal和nginx不能很好地协同工作,nginx,angular,Nginx,Angular,我在使用nginx服务angular2 universal时遇到问题 我运行的应用程序的根目录如下: npm运行build以准备可分发的捆绑包 npm start构建客户端应用程序并启动web服务器 这是我的nginx: 服务器{ 监听80个默认_服务器; 侦听[:]:80默认_服务器; root/var/greenlabel starter/src; #如果您正在使用php,请将index.php添加到列表中 index index.html index.htm index.php index

我在使用nginx服务angular2 universal时遇到问题

我运行的应用程序的根目录如下:

npm运行build
以准备可分发的捆绑包
npm start
构建客户端应用程序并启动web服务器

这是我的nginx:

服务器{
监听80个默认_服务器;
侦听[:]:80默认_服务器;
root/var/greenlabel starter/src;
#如果您正在使用php,请将index.php添加到列表中
index index.html index.htm index.php index.nginx-debian.html;
#server_name example.net;
地点/{
#首先尝试将请求作为文件提供,然后
#作为目录,然后返回显示404。
try_files$uri$uri/=404;
}
#这里我们只传递基本路径
位置=/{
代理集头X-Real-IP$remote\u addr;
代理设置头主机$http\U主机;
代理通行证http://127.0.0.1:3000;
}
#在这里,我们将代理传递所有browsersync内容,包括
#所有websocket流量
位置/测试{
代理集头X-Real-IP$remote\u addr;
代理通行证http://127.0.0.1:3000;
proxy_http_版本1.1;
代理设置头升级$http\U升级;
代理设置头连接“升级”;
代理设置头主机$Host;
}
}
问题是:

404

是index.html

 <script src="/index.js"></script>

文件位于dist/server/index.js中

如何找到该文件以避免出现错误