Nginx https support

产生证书文件:
openssl genrsa -des3 -out jack.key 2048
openssl req -new -key jack.key -out jack.csr
openssl req -new -x509 -days 3650 -key jack.key -out jack.crt

#passwd: passphrase

启动nginx 免密码,要重新 生成key文件
openssl rsa -in jack.key -out jack.key.passfree

nginx 配置:
server{
         listen       443 ssl;
 
        rewrite_log on;

ssl_certificate ××××/key/jack.crt;
ssl_certificate_key  ××××/key/key_passfree/jack.key;
        ssl_session_timeout 5m;
ssl_protocols SSLv3 TLSv1;
ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
ssl_prefer_server_ciphers on;

}
#Redirect the request from the original http port to port 443
server {
                listen *:9999;
        return 301 https://192.168.1.224$request_uri;
}

If you want to support both http and https, copy a server


Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326713165&siteId=291194637