Chinaunix首页 | 论坛 | 博客
  • 博客访问: 347496
  • 博文数量: 45
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 885
  • 用 户 组: 普通用户
  • 注册时间: 2015-05-06 21:07
个人简介

做好自己,不卑不亢,持之以恒!!

文章分类

全部博文(45)

分类: 系统运维

2015-08-15 18:10:02

一:Nginx的证书认证:

# vim /usr/local/lnmp/nginx/conf/nginx.conf
server {
           listen       443 ssl;
           server_name  localhost;

           ssl_certificate  cert.pem;
           ssl_certificate_key  cert.pem;

           ssl_session_cache    shared:SSL:1m;
           ssl_session_timeout   5m;

           ssl_ciphers  HIGH:!aNULL:!MD5;
           ssl_prefer_server_ciphers  on;

           location / {
           root  html;
           index   index.html index.htm;
        }
    }

# cd /etc/pki/tls/certs/

# cp cert.pem /usr/local/lnmp/nginx/conf/



虚拟用户的创建:
# vim /usr/local/lnmp/nginx/conf/nginx.conf
server {
        listen         80;
        server_name    www.lnmp.org;
#        access_log     logs/lnmp.org.access.log main;
        location / {
        index index.html;
        root   /www/www.lnmp.org;
        }
}
server {
        listen         80;
        server_name    www.test.org;
#        access_log     logs/linux.org.access.log main;
        location  / {
        index index.html;
        root   /www/www.test.org;
        }
 }

# mkdir /www/www.test.org/  -p
# mkdir /www/www.lnmp.org
# echo "www.lnmp.org" > /www/www.linux.org/index.html
# echo "www.test.org"  > /www/www.test.org/index.html
# vim /etc/hosts
    192.168.122.10  www.lnmp.org www.test.org
# nginx  -t
# nginx -s reload

负载均衡




nginx  -t检测无误后,nginx  -s   reload 重启nginx













阅读(2428) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~