内容简介:安装依赖本站基于 Centos7+Oneinstack 搭建,如果你使用其它发行版,与包管理有关的命令请自行调整。首先安装依赖库和编译要用到的工具:
安装依赖
本站基于 Centos7+Oneinstack 搭建,如果你使用其它发行版,与包管理有关的命令请自行调整。
首先安装依赖库和编译要用到的工具:
yum -y install build-essential libpcre3 libpcre3-dev zlib1g-dev unzip git
获取必要组件
ngx_brotli
cd /root/oneinstack/src git clone https://github.com/google/ngx_brotli.git cd ngx_brotli git submodule update --init cd ../
OpenSSL
为了支持 TLS 1.3 final,需要使用 OpenSSL 1.1.1 正式版:
wget http://mirrors.linuxeye.com/oneinstack/src/openssl-1.1.1.tar.gz tar xzf openssl-1.1.1.tar.gz
Pcre
wget http://mirrors.linuxeye.com/oneinstack/src/pcre-8.42.tar.gz tar xzf pcre-8.42.tar.gz
编译并安装 Nginx
接着就可以获取 Nginx 源码,编译并安装:
wget -c http://nginx.org/download/nginx-1.15.6.tar.gz tar zxf nginx-1.15.6.tar.gz cd nginx-1.15.6 make clean ./configure --prefix=/usr/local/nginx --user=www --group=www --with-http_stub_status_module --with-http_v2_module --with-http_ssl_module --with-http_gzip_static_module --with-http_realip_module --with-http_flv_module --with-http_mp4_module --with-openssl=../openssl-1.1.1 --with-openssl-opt='enable-tls1_3 enable-weak-ssl-ciphers' --with-pcre=../pcre-8.42 --with-pcre-jit --with-ld-opt=-ljemalloc --add-module=../ngx_brotli make mv /usr/local/nginx/sbin/nginx{,_`date +%m%d`} #备份现有nginx cp objs/nginx /usr/local/nginx/sbin/ #更新nginx nginx -t #检查nginx语法
enable-tls1_3 是让 OpenSSL 支持 TLS 1.3 的关键选项;而 enable-weak-ssl-ciphers 的作用是让 OpenSSL 继续支持 3DES 等不安全的 Cipher Suite,如果你打算继续支持 IE8,才需要加上这个选项。
WEB 站点配置
在 Nginx 的站点配置中,以下两个参数需要修改:
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # 增加 TLSv1.3 ssl_ciphers TLS13-AES-256-GCM-SHA384:TLS13-CHACHA20-POLY1305-SHA256:TLS13-AES-128-GCM-SHA256:TLS13-AES-128-CCM-8-SHA256:TLS13-AES-128-CCM-SHA256:EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
包含 TLS13 是 TLS 1.3 新增的 Cipher Suite,加在最前面即可;如果你不打算继续支持 IE8,可以去掉包含 3DES 的 Cipher Suite。
service nginx restart
以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网
猜你喜欢:本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Twenty Lectures on Algorithmic Game Theory
Tim Roughgarden / Cambridge University Press / 2016-8-31 / USD 34.99
Computer science and economics have engaged in a lively interaction over the past fifteen years, resulting in the new field of algorithmic game theory. Many problems that are central to modern compute......一起来看看 《Twenty Lectures on Algorithmic Game Theory》 这本书的介绍吧!