[root@baihl baihl]# /usr/local/nginx/sbin/nginx -V nginx version: nginx/1.15.9 built by gcc 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC) built with OpenSSL 1.0.2k-fips 26 Jan 2017 TLS SNI support enabled configure arguments: --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module
[root@baihl ssl]# openssl req -new -key server.key -out server.csr Enter pass phrase for server.key: You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) [XX]:CN State or Province Name (full name) []:Beijing Locality Name (eg, city) [Default City]:Beijing Organization Name (eg, company) [Default Company Ltd]:venus Organizational Unit Name (eg, section) []:venus Common Name (eg, your name or your server's hostname) []:baihl Email Address []:123@qq.com
Please enter the following 'extra' attributes to be sent with your certificate request A challenge password []:123456 An optional company name []:venus
location / { root html; index index.html index.htm; } }
上述配置中,由于目前开发测试需求,暂时屏蔽了RC4、DH、DHE、ECDHE这几个算法
2.4 启动nginx并访问
完成上述配置以后,保存退出,使用如下命令检查配置的正确性:
1 2 3
[root@baihl ssl]# nginx -t nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful