Nginx配置SSL

Posted 694297232

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Nginx配置SSL相关的知识,希望对你有一定的参考价值。

HTTPS访问配置方案

# HTTPS server
#
server {
    listen       443 ssl;
    server_name www.zj***.com zj***.com;

    ssl_certificate      /usr/local/nginx/sslkey/zj***.com_bundle.crt;
    ssl_certificate_key  /usr/local/nginx/sslkey/zj***.com.key;

    ssl_session_cache shared:SSL:1m;
    ssl_session_timeout  5m;

    ssl_protocols TLSv1 TLSv1.1 TLSv1.2; 
    ssl_ciphers ECDH:AESGCM:HIGH:!RC4:!DH:!MD5:!aNULL:!eNULL;
    ssl_prefer_server_ciphers on;

    location / {
        root html;
        index index.html index.htm;
        if ($http_user_agent ~* "java|python|perl|ruby|curl|bash|echo|uname|base64|decode|md5sum|select|concat|httprequest|nmap|scan" ) {
                return 403;
        }
        # proxy_pass http://localhost:8080;
        proxy_pass http://mydomain.com;
        proxy_buffer_size 128k;
        proxy_buffers   32 128k;
        proxy_busy_buffers_size 128k;
        proxy_temp_file_write_size 64m;
    }
}

 

以上是关于Nginx配置SSL的主要内容,如果未能解决你的问题,请参考以下文章

Nginx负载均衡ssl原理生成ssl密钥对Nginx配置ssl

nginx负载均衡,ssl原理,生成ssl秘钥对,nginx配置ssl

nginx配置ssl证书,允许ssl访问

Nginx负载均衡 ssl原理 生成ssl密钥对 Nginx配置ssl

Nginx配置SSL证书

Nginx配置SSL证书