nginx配置ssl注意事项
2014-09-18 16:32
375 查看
最近有个项目需要在nginx上配置ssl具体实施部署方法如下:
创建nginx证书配置目录
进入nginx配置文件目录/usr/local/nginx/ssl
证书颁发好之后需要把证书文件(server.cer)、server.key、server.csr这三个文件放到nginx ssl配置目录中
“/usr/local/nginx/conf/ssl“
在nginx.conf里配置ssl
server {
listen 443;
server_name www.xxx.com;
ssl on;
ssl_certificate /usr/local/nginx/conf/server.cer;
ssl_certificate_key /usr/local/nginx/conf/server.key;
ssl_session_timeout 5m;
ssl_protocols SSLv2 SSLv3 TLSv1;
ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
ssl_prefer_server_ciphers on;
location / { root html; index index.html index.htm; }
}
重启nginx
爱慕尔商城
服装搭配
城市物语
穿衣搭配博客
服装搭配博客
创建nginx证书配置目录
#mkdir -p /usr/local/nginx/conf/ssl
进入nginx配置文件目录/usr/local/nginx/ssl
#cd /usr/local/nginx/conf/ssl在服务器上生成私钥
#openssl genrsa -out server.key 2048生成csr文件
#openssl req -new -key server.key -out server.csr You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) [XX]: State or Province Name (full name) []: Locality Name (eg, city) [Default City]: Organization Name (eg, company) [Default Company Ltd]: Organizational Unit Name (eg, section) []: Common Name (eg, your name or your server's hostname) []: 自己需要ssl的域名 Email Address []: Please enter the following 'extra' attributes to be sent with your certificate request A challenge password []: An optional company name []:生成好csr文件后需要把这个文件提交给证书供应商让他们颁发证书。
证书颁发好之后需要把证书文件(server.cer)、server.key、server.csr这三个文件放到nginx ssl配置目录中
“/usr/local/nginx/conf/ssl“
在nginx.conf里配置ssl
server {
listen 443;
server_name www.xxx.com;
ssl on;
ssl_certificate /usr/local/nginx/conf/server.cer;
ssl_certificate_key /usr/local/nginx/conf/server.key;
ssl_session_timeout 5m;
ssl_protocols SSLv2 SSLv3 TLSv1;
ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
ssl_prefer_server_ciphers on;
location / { root html; index index.html index.htm; }
}
重启nginx
爱慕尔商城
服装搭配
城市物语
穿衣搭配博客
服装搭配博客
相关文章推荐
- SSL在tomcat上的配置,nginx上的简单配置。及其注意事项
- nginx配置注意事项
- Ubuntu 14.04 配置 Nginx + uWSGI 托管 virtualenv 下 Flask 应用的一点注意事项
- Nginx配置proxy_pass时的注意事项
- nginx中文件路径映射配置注意事项:alias与root说明
- ubuntu下配置nginx 加php需注意事项
- nginx 配置多虚拟主机需要注意事项
- 配置nginx代理服务器的几个注意事项
- nginx代理配置注意事项
- nginx配置注意事项1
- Linux(Centos)之安装Nginx及注意事项 阅读目录 1.Nginx的简单说明 2.准备工作 3.安装SSL功能需要openssl库以及gzip模块需要的zlib库 4.安装 rewri
- nginx配置注意事项2
- apache 环境下 php 的配置注意事项
- 配置web负载注意事项
- 配置路由图RouteMap的注意事项
- XFire 配置文件注意事项
- .NET环境下每日集成(4):CruiseControl.Net配置注意事项
- 关于bugzilla与svn结合的配置注意事项
- APPACH 配置COGNOS POWERPLAY虚拟目录注意事项
- Silverlight安装配置与注意事项