- 我的
Angular
项目编译的命令是:ng build --prod --aot --base-href ./
- 我的
CentOS7.3
中安装的nginx
版本号是:1.16.1 - 安装路径是
/etc/nginx
,配置文件angular.conf
在目录/etc/nginx/conf.d
中的内容是:
(把该目录下的其他后缀是conf的文件都修改为:*.conf1了)
server {
listen 80;
server_name 192.168.190.131; # 我的 CentOS的IP地址
root /chanchaw/app/angular; # 我的Angular编译后的文件放在这里
location / {
try_files $uri $uri/ /index.html;
}
}
- 浏览器中访问:http://192.168.190.131/index....
- 页面显示一片空白,F12后看到错误提示
GET https://192.168.190.131/styles.d7daca3ef5ef8cb021d3.css net::ERR_CONNECTION_RESET
GET https://192.168.190.131/runtime-es2015.970e4ee50a9015fe307c.js net::ERR_CONNECTION_RESET
GET https://192.168.190.131/favicon.ico net::ERR_CONNECTION_RESET
- 在
CentOS
中查看nginx
服务:netstat -anput|grep nginx
结果显示:tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 7453/nginx: master
- 要如何解决?QQ = 409223171
nginx config
index.html