配置文件出现重复多半是配置文件出错了:
server {
listen 80;
server_name localhost;
重启nginx出现警告:
[root@server6 www2]# nginx -s reload
nginx: [warn] conflicting server name "localhost" on 0.0.0.0:80, ignored
[root@server6 www2]# nginx -t
nginx: [warn] conflicting server name "localhost" on 0.0.0.0:80, ignored
nginx: the configuration file /usr/local/lnmp/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/lnmp/nginx/conf/nginx.conf test is successful
修改配置文件:
server {
listen 443 ssl;
server_name localhost;
可以正常启动:
[root@server6 conf]# vim nginx.conf
[root@server6 conf]# nginx -t
nginx: the configuration file /usr/local/lnmp/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/lnmp/nginx/conf/nginx.conf test is successful
[root@server6 conf]# nginx -s reload