【发布时间】:2018-10-02 00:30:02
【问题描述】:
我无法使用 nginx 运行我的 Angular 4 应用程序。我已经检查了 nginx 的 error.log 我看到了这个
2018/04/21 12:49:52 [错误] 13961#13961: *1 open() “/root/test/myapp/web-portal/index.html”失败(13: 权限被拒绝)
我正在使用 sudo 运行所有命令。我的 nginx 配置是
server {
listen 80 default_server;
listen [::]:80 default_server;
# Add index.php to the list if you are using PHP
root /root/test/myapp/web-portal/index.html;
index index.html index.htm index.nginx-debian.html;
server_name _;
location /admin {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri /index.html =404;
}
}
我尝试了 chmod 但对我不起作用
chmod -R 755 /root/test/myapp/web-portal
【问题讨论】:
-
可能是端口问题,所以尝试在1023以上的端口上运行
-
显示索引文件和父文件夹的权限。哪个用户在运行 nginx?
标签: angular nginx ubuntu-14.04