安装完nginx后,想查看nginx的位置,可以通过查看软件安装路径命令
whereis nginx
这里的/usr/local/nginx/
即是nginx的安装位置,配置文件在
/usr/local/nginx/conf/
总的配置文件是
/usr/local/nginx/conf/nginx.conf
也可以直接用nginx -t 也可以直接查看nginx配置文件完整路径:
打开这个文件可以看到
整体的格式就是
http
{
server {}
include vhost/*.conf
}
关于上面include vhost/*.conf
也就是用于引入每个网站对应的conf文件,这样,每新建一个网站,就只需要在vhost路径下增加一个配置文件,比如新增test1.com.conf test2.com.conf...
等同于在总配置文件nginx.conf写上多个server{}
如下:
http
{
server{}
ser