centos7 service nginx restart不能重启了也不能start了

问答中心分类: Linuxcentos7 service nginx restart不能重启了也不能start了
andy asked 5 年 ago
这个在centos6系统所有的操作都是可以的,我现在添加了虚拟机在/usr/local/nginx/conf/vhost配置好了,始终不行一直域名进来是

恭喜您,OneinStack 安装成功!的欢迎页面

不知道7上面我怎么启动nginx加载我在/usr/local/nginx/conf/vhost下面的conf配置文件了。现在是
# service nginx restart
Redirecting to /bin/systemctl restart nginx.service
在bin下按照上面的命令提示执行后,还依旧是访问域出现:

恭喜您,OneinStack 安装成功!的欢迎页面

2 Answers
oneinstack answered 5 年 ago
# service nginx restart
Redirecting to /bin/systemctl restart nginx.service
提示这个代表nginx已经正常重启
用vhost.sh绑定域名即可

andy answered 5 年 ago
不知道为何我配置了东西我域名访问不到我自己的项目,域名一直没反应确实配置ping 正常,这个是配置vhost下的配置

 
Start your code here
listen 80; server_name xxx.com;
access_log /data/wwwlogs/xxx.com_nginx.log combined;
index index.html index.htm index.jsp; root /data/wwwroot/xxx.com/dist/;我的前端vue打包路径
if ($host != xxx.com) { return 301 $scheme://xxx.com$request_uri; }
#error_page 404 /404.html; #error_page 502 /502.html; location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp4|ico)$ { expires 30d; access_log off; } location ~ .*\.(js|css)?$ { expires 7d; access_log off; } location ~ /\.ht { deny all; } location ~ { proxy_pass http://127.0.0.1:8082;监听的我java的jar端口项目 include proxy.conf; } }
Start your code here