安装openssl nginx开启tsl1.3

参考1 参考2

  1. yum install -y gcc gcc-c++ perl pcre-devel openssl openssl-devel
  2. cd /soft/bak
  3. wget https://www.openssl.org/source/openssl-1.1.1g.tar.gz
  4. tar zxvf openssl-1.1.1g.tar.gz
  5. mv openssl-1.1.1g /soft/openssl
  6. cd /soft/openssl
  7. ./config
  8. make && make install
  9. ln -s /usr/local/lib64/libssl.so.1.1 /usr/lib64/
  10. ln -s /usr/local/lib64/libcrypto.so.1.1 /usr/lib64/
  11. openssl version

安装ngx_brotli

  1. cd /soft
  2. git clone https://github.com/google/ngx_brotli.git
  3. cd /soft/ngx_brotli
  4. git submodule update --init

安装nginx

官方安装方法
安装TSL1.3 泛域名证书
分别为每个域名手工生成证书
certbot certonly --nginx --nginx-server-root=/soft/nginx/conf
尽量保证页面中全部连接使用https 例如js/css等 否则在监控台和地址栏证书位置可能会报错
-j2表示两个线程并行 提高编译效率 但是对makefile文件有要求 必须依赖关系明确 否则某一线程会找不到依赖

  1. cd /soft/bak
  2. wget http://nginx.org/download/nginx-1.18.0.tar.gz
  3. tar -zxvf nginx-1.18.0.tar.gz
  4. cd /soft/bak/nginx-1.18.0
  5. ./configure --prefix=/soft/nginx \
  6. --with-http_gzip_static_module \
  7. --with-http_stub_status_module \
  8. --with-http_v2_module \
  9. --with-file-aio \
  10. --with-http_realip_module \
  11. --with-http_ssl_module \
  12. --with-openssl=/soft/openssl \
  13. --with-openssl-opt=enable-tls1_3 \
  14. --add-module=/soft/ngx_brotli
  15. make -j2&& make install
  16. mv /www/conf.d /soft/nginx/web

vi /etc/profile

  1. export PATH=$PATH:/soft/nginx/sbin

source /etc/profile