在本地主机(Ubuntu14.1)中使用NGINX服务器托管多个网站
为了承载多个网站,我更新了/etc/nginx/default文件,如下所示:在本地主机(Ubuntu14.1)中使用NGINX服务器托管多个网站,ubuntu,nginx,host,Ubuntu,Nginx,Host,为了承载多个网站,我更新了/etc/nginx/default文件,如下所示: server { listen 8080; server_name test; root /var/www/test; client_max_body_size 3096M; location ~* \.(jpg|jpeg|png|gif|ico|css|js){ expires max; } } 在此之后,我将/etc/hosts文件编辑为: IP
server {
listen 8080;
server_name test;
root /var/www/test;
client_max_body_size 3096M;
location ~* \.(jpg|jpeg|png|gif|ico|css|js){
expires max;
}
}
在此之后,我将/etc/hosts文件编辑为:
IP address localhost test;
最后一步:
service nginx restart / service nginx reload
使用:访问网站,但它正在重定向到localhost并显示Ubuntu安装页面 测试虚拟主机正在侦听端口8080,因此您应该使用访问它