阿里雲服務器nginx配置ssl

首先下載.pem,.key文件,並在Nginx目錄下創建cert文件夾,將這兩個文件放在cert文件夾下,

然後在nginx.conf文件裏添加這段內容,root,ssl_certificate,ssl_certificate_key,server_name都要寫自己的:

server {
        listen       443;
        root /www/web/jincn/public_html;
        ssl                  on;
        ssl_certificate      cert/*****.pem;
        ssl_certificate_key  cert/*****.key;
        ssl_prefer_server_ciphers on;
        ssl_session_timeout 10m;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
        server_name ji*****t.cn;
        index  index.html index.php index.htm;
        error_page  400 /errpage/400.html;
        error_page  403 /errpage/403.html;
        error_page  404 /errpage/404.html;
        error_page  503 /errpage/503.html;
        location ~ \.php$ {
                proxy_pass http://127.0.0.1:88;
                include naproxy.conf;
        }
        location ~ /\.ht {
           deny  all;
   }
        location / {
                try_files $uri @apache;
        }
        location @apache {
                 internal;
                 proxy_pass http://127.0.0.1:88;
                 include naproxy.conf;
        }
}

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章