• linkedu视频
  • 平面设计
  • 电脑入门
  • 操作系统
  • 办公应用
  • 电脑硬件
  • 动画设计
  • 3D设计
  • 网页设计
  • CAD设计
  • 影音处理
  • 数据库
  • 程序设计
  • 认证考试
  • 信息管理
  • 信息安全
菜单
linkedu.com
导航菜单
  • 网页制作
  • 数据库
  • 程序设计
  • 操作系统
  • CMS教程
  • 游戏攻略
  • 脚本语言
  • 平面设计
  • 软件教程
  • 网络安全
  • 电脑知识
  • 服务器
  • 视频教程
  • windows
  • 服务器硬件
  • 服务器运维
  • 云计算
  • 虚拟化
  • IIS教程
  • Linux
  • Apache
  • Ftp
  • DNS
  • Nginx
您的位置:首页 > 服务器 >Linux > Centos下nginx支持https协议

Centos下nginx支持https协议

作者:网友 字体:[增加 减小] 来源:互联网

本文主要包含centos nginx https,centos卸载nginx,centos yum nginx,centos 7 nginx,centos 6.6 nginx等服务器相关知识,网友希望可以进行参考

Centos下nginx支持https协议


1、首先配置nginx及其他插件,这个Google下,很多配置方案。2、配置服务器的证书。操作步骤如下:[root@localhost ~]# cd /etc/pki/tls/certs[root@localhost certs]# make server.keyumask 77 ; \/usr/bin/openssl genrsa -aes128 2048 > server.keyGenerating RSA private key, 2048 bit long modulus......................................................++++++.............++++++e is 61251 (0x10001)Enter pass phrase:# set passphraseVerifying - Enter pass phrase:# confirm# remove passphrase from private key[root@localhost certs]# openssl rsa -in server.key -out server.keyEnter pass phrase for server.key:# input passphrasewriting RSA key[root@localhost certs]#[root@localhost certs]# make server.csrumask 77 ; \/usr/bin/openssl req -utf8 -new -key server.key -out server.csrYou are about to be asked to enter information that will be incorporatedinto 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 blankFor some fields there will be a default value,If you enter '.', the field will be left blank.-----Country Name (2 letter code) [XX]:CN #countryState or Province Name (full name) [e]:Beijing #stateLocality Name (eg, city) [Default City]:Beijing #cityOrganization Name (eg, company) [Default Company Ltd]:Test #companyOrganizational Unit Name (eg, section) []:Test Haha #departmentCommon Name (eg, your server's hostname) []:www.test.com #server's FQDNEmail Address []:admin@test.com # email addressPlease enter the following 'extra' attributesto be sent with your certificate requestA challenge password []:# EnterAn optional company name []:# Enter[root@localhost certs]#[root@localhost certs]# openssl x509 -in server.csr -out server.crt -req -signkey server.key -days 3650Signature oksubject=/C=CN/ST=Beijing/L=Beijing/O=Test/OU=Test Haha/CN=www.test.com,/emailAddress=admin@test.comGetting Private key[root@localhost certs]# chmod 400 server.*3、配置nginx的conf文件#server {# listen 80;# server_name happy.cc.com;# rewrite ^(.*)$ permanent;# }server { listen 80; listen 443 ssl; server_name happy.cc.com; location / { root /data/www/cloud; index index.html; } ssl on; ssl_certificate /data/webserver/nginx/conf/server.crt; ssl_certificate_key /data/webserver/nginx/conf/server.key; ssl_session_timeout 5m; ssl_protocols SSLv3 TLSv1; ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP; ssl_prefer_server_ciphers on; #autoindex on; location = /favicon.ico { log_not_found off; access_log off; } location ~ \.php$ { root /data/www/cloud; fastcgi_pass unix:/tmp/php-cgi.sock; #fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /data/www/cloud$fastcgi_script_name; include fastcgi_params; } location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)\$ { expires 30d; } location ~ .*\.(js|css)?\$ { expires 1h; } access_log /data/log/nginx/happy.access.log access; error_log /data/log/nginx/happy.error.log warn; }4、打开iptables的443端口

分享到:QQ空间新浪微博腾讯微博微信百度贴吧QQ好友复制网址打印

您可能想查找下面的文章:

  • CentOS云主机中Nginx正向代理同时支持 https 和 http 访问
  • Centos下nginx支持https协议

相关文章

  • centos7下快速安装mysql
  • Ubuntu 16.04 源码编译安装PHP7
  • centos7安装配置vsftp
  • Windows 10 下安装 Apache 2.4.41的教程
  • CentOS下安装redis和redis集群
  • Linux下如何永久修改主机名的方法步骤
  • Centos7.2安装Nginx实现负载平衡
  • Linux修改主机名的简单方法
  • centos服务器下nginx防盗链设置
  • Linux系统(CentOS7安装)安装JDK8的教程详解

文章分类

  • windows
  • 服务器硬件
  • 服务器运维
  • 云计算
  • 虚拟化
  • IIS教程
  • Linux
  • Apache
  • Ftp
  • DNS
  • Nginx

最近更新的内容

    • Linux中Varnish基础应用
    • Ubuntu 16.04源码编译安装Nginx 1.10.0
    • Docker桥接网络原理图分享和pipework简单配置
    • 使用 Linux seq 命令生成数字序列(推荐)
    • centos 搭建dns服务器 解析任意域名
    • CentOS云主机中Nginx正向代理同时支持 https 和 http 访问
    • CentOS7 安装Mysql5.7(解压缩版)
    • centos服务器下nginx防盗链设置
    • 详解CentOS 8 VMware虚拟机设置静态ip网卡上网
    • centos7安装配置vsftp

关于我们 - 联系我们 - 免责声明 - 网站地图

©2020-2025 All Rights Reserved. linkedu.com 版权所有