nginx multi-site configuration
Reference the blog: https://www.linuxidc.com/Linux/2017-11/148532.htm
- First you have to create a new Nginx configuration
//进入目录
cd /etc/nginx/sites-enabled
//拷贝配置文件
cp default site1
//修改配置文件
vim site1
Modify the configuration file, modify the port information
to modify the site root
Save out!
- Then we create a website directory under index.php
//进入根目录
cd /var/www
//创建网站文件夹
mkdir site1
//进入目录
cd site1
//创建index.php
vim index.php
//在文件中写入
<?php
echo phpinfo();
?>
//保存退出,重启一下nginx
sudo service nginx restart
- Then we visit our domain name, or IP, accessed via ip or domain name, later to add: port number! Can not access the service provider's gonna open that port job Oh!
If the following chart shows, on behalf of multi-site configuration successful!