nginx+openssl 搭建记录

nginx下载地址:http://nginx.org/en/download.html
上传到opt/soft目录

cd /opt/soft
tar -zxvf nginx-1.17.0.tar.gz
cd nginx-1.17.0
yum install -y gcc
yum install -y pcre pcre-devel
yum install -y zlib zlib-devel
yum install -y openssl openssl-devel

 ./configure --with-http_ssl_module --with-pcre --with-stream --with-stream_ssl_module --with-http_ssl_module --with-http_v2_module --with-threads
配置汇总
make && make install

开启启动配置

vi /etc/rc.d/rc.local

#!/bin/bash
# THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES
#
# It is highly advisable to create own systemd services or udev rules
# to run scripts during boot instead of using this file.
#
# In contrast to previous versions due to parallel execution during boot
# this script will NOT be run after all other services.
#
# Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure
# that this script will be executed during boot.

touch /var/lock/subsys/local

#增加下面这一行,如果你的nginx也安装在这个位置的话。
/usr/local/nginx/sbin/nginx

检查/etc/rc.d/rc.local是否为可执行文件
chmod +x /etc/rc.d/rc.local


生成ssl key教程
免费证书申请地址良心网站
http强制跳转https
ssl状态监测网址

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容