Nginx修改配置文件添加网站,命令如下:
一、打开nginx的配置文件:
vi /usr/local/nginx/conf/nginx.conf
进行修改。
二、执行:
/usr/local/nginx/sbin/nginx -t 检查配置是否正常,
如果显示:the configuration file /usr/local/ nginx/conf/nginx.conf syntax is ok
configuration file /usr/local/ nginx/conf/nginx.conf test is successful
则正常,否则按错误提示修改配置。
三、确认配置正确后,重启:
/etc/init.d/nginx restart