首先,编译最新的OPENSSL以支持TLS1.3

源码下载地址:https://www.openssl.org/source/

tar -xzvf *.gz
cd openssl_1.1.1
./config -Wl,--enable-new-dtags,-rpath,'$(LIBRPATH)'
make -j8
make install
ln -s /usr/local/bin/openssl /usr/bin/openssl
ln -s /usr/local/include/openssl /usr/include/openssl
echo "/usr/local/lib" >> /etc/ld.so.confCode language: PHP (php)

这里要注意一下,如果不在config上附加参数再编译,可能会导致出错。后面几步为替换内置openssl,以避免麻烦。

再则,编译最新的NGINX以支持brotli压缩算法(以APT参数的基础上添加部分参数)

./configure --with-openssl=/www/ngx_module/openssl-1.1.1 --with-openssl-opt=enable-tls1_3 --with-cc-opt='-g -O2 -fdebug-prefix-map=/build/nginx-arCSgL/nginx-1.14.0=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Wdate-time -D_FORTIFY_SOURCE=2' --with-ld-opt='-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -fPIC' --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --modules-path=/usr/lib/nginx/modules --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-debug --with-pcre-jit --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_auth_request_module --with-http_v2_module --with-http_dav_module --with-http_slice_module --with-threads --with-http_addition_module --with-http_geoip_module=dynamic --with-http_gunzip_module --with-http_gzip_static_module --with-http_image_filter_module=dynamic --with-http_sub_module --with-http_xslt_module=dynamic --with-stream=dynamic --with-stream_ssl_module --with-mail=dynamic --with-mail_ssl_module --add-module=/www/ngx_module/ngx_brotli
Code language: JavaScript (javascript)

以上。


0 条评论

发表回复

Avatar placeholder

您的电子邮箱地址不会被公开。 必填项已用 * 标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据