ubuntu nginx 配置虚拟域名

复制nginx/sites-available/default到conf.d目录下,并添加后缀conf

cp -r defalut /etc/nginx/conf.d/example.conf

修改root, server name 等

server_name:修为自己的本地域名,如www.example.com

修改/etc/hosts

在127.0.0.1  localhost下面添加域名, 跟windows下修改hosts一样

猜你喜欢

转载自blog.csdn.net/tang05709/article/details/82252014