- 修改nginx.conf文件
server {
listen 80;
server_name www.ttba.com;
root html ;
index index.html;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
# root html;
# index index.html index.htm;
}
2.修改hosts文件
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.1.101 www.ttba.com
3.重新启动nginx
./nginx -s reload;
此时就可以通过域名进行访问了。