修改nginx的配置文件nginx.conf
vim /usr/local/nginx/conf/nginx.conf
一个server对象代表一个项目
server {
listen 80;
server_name a.baidu.com;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
location / {
root /www/wwwroot/tp5;
index index.php index.html index.htm;
}
}
server {
listen 80;
server_name b.baidu.com;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
location / {
root /www/wwwroot/laravel;
index index.php index.html index.htm;
}
}
server对象中的server_name
表示你备案通过的域名
location对象中的root
表示你的项目的路径
location对象中的index
表示使用域名时的默认访问文件