1,先去这个网站申请一下证书

https://certmall.trustauth.cn/Home/Member/index/id/1521167511.html

上面会教你怎么去做。

2,就是配置自己的nginx了。

记得这个以来一定要安装

yum install openssl openssl-devel

参看下面2个文档。

http://www.cnblogs.com/chen-msg/p/8582374.html

http://www.cnblogs.com/chen-msg/p/7754411.html

3,配置

nginx.conf

#user  nobody;
worker_processes 1; #error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info; #pid logs/nginx.pid; events {
worker_connections 1024;
} http {
include mime.types;
default_type application/octet-stream; #log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"'; #access_log logs/access.log main; sendfile on;
#tcp_nopush on; #keepalive_timeout 0;
keepalive_timeout 65; #gzip on; server {
listen 80;
server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / {
root /opt/my/html/pc/html/html;
index index.html;
} location /sendTKL/ {
proxy_pass http://127.0.0.1:8688/water-tk-main/tklConvert/;
} location /mytk/ {
proxy_pass http://127.0.0.1:8688/water-tk-main/;
proxy_set_header Host $host:$server_port; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
} # proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#} # deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
} # another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias; # location / {
# root html;
# index index.html index.htm;
# }
#} # HTTPS server
#
server {
listen 443 ssl;
server_name www.ttgwzs.com; #网站域名,和80端口保持一致
ssl on;
ssl_certificate /usr/local/nginx--with-http_stub_status_module/conf/www.ttgwzs.com_bundle.crt; #证书公钥
ssl_certificate_key /usr/local/nginx--with-http_stub_status_module/conf/www.ttgwzs.com.key; #证书私钥
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers ECDH:AESGCM:HIGH:!RC4:!DH:!MD5:!3DES:!aNULL:!eNULL;
ssl_prefer_server_ciphers on;
location / {
proxy_pass http://www.ttgwzs.com;
proxy_redirect off;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Cookie $http_cookie;
#proxy_cookie_path
chunked_transfer_encoding off; } }
}

nginx 配置 https 请求的更多相关文章

  1. Nginx 配置https请求

    通过阿里云生成指定的https证书文件xxxx.key 和 xxxx.pem文件 在阿里云上申请的https证书的是pem格式,转成cer 先在终端cd到文件目录下 然后 openssl x509 - ...

  2. 【转】Linux下nginx配置https协议访问的方法

    一.配置nginx支持https协议访问,需要在编译安装nginx的时候添加相应的模块--with-http_ssl_module 查看nginx编译参数:/usr/local/nginx/sbin/ ...

  3. nginx配置https双向验证(ca机构证书+自签证书)

    nginx配置https双向验证 服务端验证(ca机构证书) 客户端验证(服务器自签证书) 本文用的阿里云签发的免费证书实验,下载nginx安装ssl,文件夹有两个文件 这两个文件用于做服务器http ...

  4. Nginx 配置https 服务

    一.HTTPS 服务 为什么需要HTTPS? 原因:HTTP不安全 1.传输数据被中间人盗用.信息泄露 2.数据内容劫持.篡改 HTTPS协议的实现 对传输内容进行加密以及身份验证 HTTPS加密校验 ...

  5. nginx配置https转发到tomcat(使用自签名的证书)

    一.使用openSSL生成自签名的证书 1.生成RSA私钥 命令:openssl genrsa -des3 -out server.key 1024 说明:生成rsa私钥,des3算法,1024强度, ...

  6. RedHat 6.6下安装nginx,配置HTTPS

    1.安装依赖包 yum -y install pcre-devel openssl-devel zlib-devel 2.下载nginx安装包到服务器上,当前使用版本nginx-1.15.5.tar. ...

  7. nginx 配置https并自签名证书

    2016-10-28 转载请注明出处:http://daodaoliang.com/ 作者: daodaoliang 版本: V1.0.1 邮箱: daodaoliang@yeah.net 参考链接: ...

  8. Nginx 配置 HTTPS(多域名)

    平常开发要求比较低, 依然在用 HTTP, 但到了微信小程序就不行了, 腾讯和苹果都对 API 提出了 HTTPS 的要求. 尤其是苹果, 不仅要求 HTTPS, 还要求 TLS 协议版本要在 1.2 ...

  9. Nginx配置Https(详细、完整)

    Nginx配置Https(详细.完整) 原文链接:请支持原创 前置条件: 在配置https之前请确保下面的步骤已经完成 服务器已经安装nginx并且通过http可以正常访问 不会安装nginx的可以参 ...

随机推荐

  1. javascript(二):数据类型&数值

    第一部分:数据类型 javascript数据类型通常来说是6种(ES6新增第七种Symbol类型) number:数值 string:字符串 boolean:布尔类型,true或false undef ...

  2. Vue系列之 => 组件切换

    组件切换方式一 <!DOCTYPE html> <html lang="en"> <head> <meta charset="U ...

  3. Java基础(basis)-----代码块详解

    1.静态代码块 格式: static{ 内容..... } 随着类的加载而加载,而且只被加载一次 多个静态代码块之间按照顺序结构执行 优先其他各种代码块以及构造函数先执行 静态的代码块中只能执行静态的 ...

  4. OC 反射-->动态创建类

    系统方法 NSLog(@"%s", __func__); //打印出类的方法名称,如: //打印结果:2018-02-22 10:52:15.394575+0800 DemoRun ...

  5. 【Hbase学习之五】HBase MapReduce

    环境 虚拟机:VMware 10 Linux版本:CentOS-6.5-x86_64 客户端:Xshell4 FTP:Xftp4 jdk8 hadoop-2.6.5 hbase-0.98.12.1-h ...

  6. 常对象与this指针

    [1]示例代码 用代码说事,比较靠谱.请看下例: #include <QDebug> #include <QString> class Person { public: Per ...

  7. 利用python 数据分析入门,详细教程,教小白快速入门

    这是一篇的数据的分析的典型案列,本人也是经历一次从无到有的过程,倍感珍惜,所以将其详细的记录下来,用来帮助后来者快速入门,,希望你能看到最后! 需求:对obo文件进行解析,输出为json字典格式 数据 ...

  8. python XML文件解析:用ElementTree解析XML

    Python标准库中,提供了ET的两种实现.一个是纯Python实现的xml.etree.ElementTree,另一个是速度更快的C语言实现xml.etree.cElementTree.请记住始终使 ...

  9. RN与android原生开发混合后的环境报错问题

    RN与android原生开发混合后的环境报错问题 需要先安装nodejs$ yarn --version1.12.1更新当前版本yarn upgrade --latest安装 | Yarnhttps: ...

  10. Codeforce 287A - IQ Test (模拟)

    In the city of Ultima Thule job applicants are often offered an IQ test. The test is as follows: the ...