nginx -t报错:nginx: [warn] conflicting server name “localhost“ on 0.0.0.0:80, ignored

Reason for error: used in multiple configuration files server_name localhostor used multiple times in the server of one configuration fileserver_name localhost

Solution: Delete the redundant server_name localhost, or modify the suffix of other configuration files, not .conf.
You can use the following command to check:
grep -r localhost /usr/local/nginx/
find out all the files and their lines that contain localhost in this directory.

Guess you like

Origin blog.csdn.net/weixin_36522099/article/details/108265349