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.重启就行

  • 相关阅读:
    2.完全背包问题
    1.01背包问题
    19.区间合并
    18.区间和
    16.数组元素的目标和
    15.最长连续不重复子序列
    14.差分矩阵
    1.注册七牛云账号
    1.1 linux查看系统基本参数常用命令
    图书管理增删改查&父子调用&前后端
  • 原文地址:https://www.cnblogs.com/shiwenhu/p/5556359.html
Copyright © 2011-2022 走看看