- 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;
}
}
- 注意事项
- nginx -V 检查nginx是否是编译过的 --with-http_ssl_module
- cert 证书目录 放在nginx 安装目录 conf目录下
- nginx -t 在你nginx -s reload 之前 最好用 nginx -t 检查一下配置文件是否有错误
4.nginx 504 timeout
location / {
。。。
proxy_connect_timeout 300s;
proxy_send_timeout 300s;
proxy_read_timeout 300s;
。。。
}
网友评论