nginx https

2019-07-09  本文已影响0人  十二找十三
  1. nginx -v nginx -V nginx -t
nginx -v   //  nginx version: nginx/1.9.15
nginx -V  

nginx version: nginx/1.9.15
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC) 
built with OpenSSL 1.0.2k-fips  26 Jan 2017
TLS SNI support enabled
configure arguments: --prefix=/root/home/nginx-1.9.15 --with-http_stub_status_module --with-http_ssl_module

nginx -t 
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

2.nginx.conf https配置

server {
    listen 443 ssl;
    server_name www.aaa.com;// 你的域名
    ssl on;
    ssl_certificate   cert/a.pem;
    ssl_certificate_key  cert/a.key;
    ssl_session_timeout 5m;
    ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_prefer_server_ciphers  on;  
    location / {
        root html;
        index index.html;
    }
}
  1. 注意事项

4.nginx 504 timeout
location / {
。。。

proxy_connect_timeout 300s;
proxy_send_timeout 300s;
proxy_read_timeout 300s;
。。。

}

上一篇 下一篇

猜你喜欢

热点阅读