nginx网页加密访问
[root@server1 ~]# cd /usr/local/lnmp/nginx/conf/
[root@server1 conf]# vim nginx.conf
123 server{
124 listen 80;
125 server_name www.westos.org;
126
127 location / {
128 root /www1;
129 index index.html;
130 }
131 }
132
133 server{
134 listen 80;
135 server_name www.linux.org;
136
137 location / {
138 root /www2;
139 index index.html;
140 }
141
142 }
[root@server1 conf]# mkdir /www1
[root@server1 conf]# mkdir /www2
[root@server1 conf]# cd /www1/
[root@server1 www1]# vim index.html
www.westos.org
[root@server1 www1]# cd /www2/
[root@server1 www2]# vim index.html
www.linux.org
[root@server1 www2]# cd /usr/local/lnmp/nginx/
[root@server1 nginx]# cd sbin/
[root@server1 sbin]# ./nginx -s reload
主机解析:
[root@foundation40 Desktop]# vim /etc/hosts
172.25.40.1 www.westos.org bbs.westos.org www.linux.org