ubuntu利用nginx配置https服务器
来源:互联网 发布:qt高级编程 源码 qt5 编辑:程序博客网 时间:2024/05/19 23:01
参考:http://www.cnblogs.com/yanghuahui/archive/2012/06/25/2561568.html
http://www.linuxidc.com/Linux/2011-11/47477.htm
http://www.linuxidc.com/Linux/2011-11/47477.htm
http://blog.csdn.net/sean_cd/article/details/38738599
nginx -V
查看nginx 的ssl配置有没有–with-http_ssl_module。如果没有发现–with-http_ssl_module这个编译参数,说明不支持。Nginx默认是不支持SSL的,需要加入–with-http_ssl_module参数重新编译。
apt-get install openssl
cd /etc/nginx/
创建服务器私钥,命令会让你输入一个口令:
openssl genrsa -des3 -out server.key 1024
创建签名请求的证书(CSR)
openssl req -new -key server.key -out server.csr
在加载SSL支持的Nginx并使用上述私钥时除去必须的口令:
openssl rsa -in server.key -out server_nopwd.key
最后标记证书使用上述私钥和CSR
openssl x509 -req -days 365 -in server.csr -signkey server_nopwd.key -out server.crtvi /etc/nginx/nginx.conf
在http段中加入:
server {
#listen 80;
listen 443;
server_name YourServerName;
root /var/mypagedir;
index index.php index.html index.htm;
ssl on;
ssl_certificate /etc/nginx/server.crt;
ssl_certificate_key /etc/nginx/server_nopwd.key;
}
server {
#listen 80;
listen 443;
server_name YourServerName;
root /var/mypagedir;
index index.php index.html index.htm;
ssl on;
ssl_certificate /etc/nginx/server.crt;
ssl_certificate_key /etc/nginx/server_nopwd.key;
}
重启niginx
service nginx restart
在/var/mypagedir中放入网页文件,访问验证是否成功
0 0
- ubuntu利用nginx配置https服务器
- ubuntu nginx配置https服务器
- Nginx配置https服务器
- nginx 配置HTTPS服务器
- nginx配置https服务器
- nginx配置HTTPS服务器
- Ubuntu nginx 配置https
- ubuntu nginx 配置 https
- 【HTTPS服务器配置】----Nginx配置
- nginx上配置https服务器
- Nginx + StartSSL 配置https服务器
- nginx服务器配置支持https
- Ubuntu下配置Nginx HTTPS
- Ubuntu下Nginx配置Https
- Nginx服务器配置HTTPS nginx.config 配置文件
- HTTPS配置入门:Nginx、Node.js配置HTTPS服务器
- 服务器数据库系列 - Nginx HTTPS配置
- 简单的 nginx https 服务器配置
- 反方向ProgressBar
- DOM元素的各种宽度和高度
- 柱状图 js工具highcharts
- Android购物车的实现(升级版 仿淘宝)
- 2016寒假个人赛(1)J(模拟)
- ubuntu利用nginx配置https服务器
- 三层登录—c#
- float--->double 的转换
- java工程引入jar包
- ImageLoader
- iOS MBProgressHUD的简单使用
- 多项选择~checkbox的简单运用
- Android 坐标系
- Linux下tcpdump和Wireshark抓包的数据结构