zoukankan      html  css  js  c++  java
  • nginx配置https

    nginx配置https之前,一定要安装了ssl模块,要不然是不可以用的。在nginx启动时会出现这种错误:

    nginx: [emerg] unknown directive "ssl" in /usr/local/nginx/conf/conf.d/ssl.conf:8
    

    出现nginx在编译完成安装之后,重新编译nginx模块

    ./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-file-aio --with-http_realip_module

    1然后编译make,但是记得别make install,否则会覆盖原来的nginx。因为make install 就是移动二进制文件到指定的目录下

    2然后记得备份一下以前的nginx二进制执行文件

    3测试配置文件是否可用

    /usr/local/nginx/sbin/nginx -t

    4.如果成功之后就滑动重启

    /usr/local/nginx/sbin/nginx -s reload

    5.配置https

    server {
        listen       443;
        server_name  sentiger.cn www.sentiger.cn;
    
            ssl     on;
            ssl_certificate  /usr/local/nginx/conf/conf.d/ssl/1_www.easyhospital.cn_bundle.crt;
            ssl_certificate_key  /usr/local/nginx/conf/conf.d/ssl/startssl_free.key;
    .....

    6.重启就行

  • 相关阅读:
    hdu 5171(矩阵快速幂,递推)
    hdu 1316(大整数)
    hdu 5170(数学)
    hdu 5167(dfs)
    hdu 5166(水题)
    hdu 5720(贪心+区间合并)
    BestCoder 2nd Anniversary的前两题
    hdu 3065(AC自动机)
    2.3绘制构造线与射线
    查找ARP攻击源
  • 原文地址:https://www.cnblogs.com/shiwenhu/p/5556359.html
Copyright © 2011-2022 走看看