nginx ssl 部分加密

# For more information on configuration, see:
#   * Official English Documentation: http://nginx.org/en/docs/
#   * Official Russian Documentation: http://nginx.org/ru/docs/

user              nginx;
worker_processes  1;

error_log  /var/log/nginx/error.log;
#error_log  /var/log/nginx/error.log  notice;
#error_log  /var/log/nginx/error.log  info;

pid        /var/run/nginx.pid;

events {
    worker_connections  1024;
}

http {
    include       /etc/nginx/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  /var/log/nginx/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;

    # Load config files from the /etc/nginx/conf.d directory
    # The default server is in conf.d/default.conf
    include /etc/nginx/conf.d/*.conf;

    upstream yzy_b2c {
    server 114.112.101.148;
    }

     server {
        listen      80;
        server_name www.qixinglicai.com;
            location / {
                proxy_pass http://114.112.101.147:8080;
                index  index.htm;
                proxy_set_header Host $host;
                proxy_set_header X-Real-Ip $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Proto $scheme;
                proxy_connect_timeout 10;
                proxy_read_timeout 120;
            }    

           location ~* /userCenter/{
                rewrite ^(.*) https://www.qixinglicai.com$1 permanent;
           }
           location ~* /userset/{
                rewrite ^(.*) https://www.qixinglicai.com$1 permanent;
           }
           location ~* (index\.ac|regist\.ac|selectUserByLog\.ac|transferDetail\.ac|transferDetail\.ac|checkfavoritepage\.ac|selectAllCommentsByParty\.ac|refercomplaint\.ac|getAllLetterForParty\.ac|getNewsSubscriptionByPartyId\.ac|tophoneident\.ac){
                rewrite ^(.*) https://www.qixinglicai.com$1 permanent;
           }

           location ~* /(shoppingCart\.ac|shoppingCartList\.ac|shoppingCartByUser\.ac|shoppingCartByContract\.ac|payOrder\.ac|sucPayOrder\.ac|checkOrder\.ac){
                rewrite ^(.*) https://www.qixinglicai.com$1 permanent;
           }

    }

    # HTTPS server
        server {
            listen       443;
            server_name  www.qixinglicai.com;

            ssl                  on;
            ssl_certificate      /usr/local/conf/mycert.cer;
            ssl_certificate_key  /usr/local/conf/mykey.key;

            ssl_session_timeout  25m;

            ssl_protocols   SSLv3 TLSv1;
            ssl_ciphers  ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
            ssl_prefer_server_ciphers   on;

             location ~* /userCenter/{
                proxy_pass http://114.112.101.147:8080;
                index  index.htm;
                proxy_set_header Host $host;
                proxy_set_header X-Real-Ip $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Proto $scheme;
                proxy_connect_timeout 10;
                proxy_read_timeout 120;
             }
             location ~* /userset/{
                proxy_pass http://114.112.101.147:8080;
                index  index.htm;
                proxy_set_header Host $host;
                proxy_set_header X-Real-Ip $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Proto $scheme;
                proxy_connect_timeout 10;
                proxy_read_timeout 120;
             }

           location ~* (index\.ac|regist\.ac|selectUserByLog\.ac|transferDetail\.ac|transferDetail\.ac|checkfavoritepage\.ac|selectAllCommentsByParty\.ac|refercomplaint\.ac|getAllLetterForParty\.ac|getNewsSubscriptionByPartyId\.ac|tophoneident\.ac){
                proxy_pass http://114.112.101.147:8080;
                index  index.htm;
                proxy_set_header Host $host;
                proxy_set_header X-Real-Ip $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Proto $scheme;
                proxy_connect_timeout 10;
                proxy_read_timeout 120;
             }

             location ~* /(shoppingCart\.ac|shoppingCartList\.ac|shoppingCartByUser\.ac|shoppingCartByContract\.ac|payOrder\.ac|sucPayOrder\.ac|checkOrder\.ac){
                proxy_pass http://114.112.101.147:8080;
                index  index.htm;
                proxy_set_header Host $host;
                proxy_set_header X-Real-Ip $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Proto $scheme;
                proxy_connect_timeout 10;
                proxy_read_timeout 120;
             }

             location ~ \.(css|js|gif|png|jpg)$ {
                proxy_pass http://114.112.101.147:8080;
                proxy_set_header Host $host;
                proxy_set_header X-Real-Ip $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Proto $scheme;
             }
             location / {
                rewrite ^(.*) http://www.qixinglicai.com$1 permanent;
             }

    }

}
时间: 2024-08-25 10:43:17

nginx ssl 部分加密的相关文章

nginx + SSL优化配置

nginx + SSL优化配置: 1 #http段添加如下配置项: 2 3 http { 4 5 ssl_prefer_server_ciphers on; #设置协商加密算法时,优先使用我们服务端的加密套件,而不是客户端浏览器的加密套件. 6 ssl_protocols TLSv1 TLSv1.1 TLSv1.2; #协议安全设置 7 ssl_ciphers ALL:!kEDH!ADH:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP; #加密套件 ssl_ciph

HTTPS协议介绍—使用Nginx+SSL实现部署与性能优化

一.HTTPS协议简介 HTTPS 可以认为是 HTTP + TLS.HTTP 协议大家耳熟能详了,目前大部分 WEB 应用和网站都是使用 HTTP 协议传输的. TLS 是传输层加密协议,它的前身是 SSL 协议,最早由 netscape 公司于 1995 年发布,1999 年经过 IETF 讨论和规范后,改名为 TLS.如果没有特别说明,SSL 和 TLS 说的都是同一个协议. HTTP 和 TLS 在协议层的位置以及 TLS 协议的组成如下图: TLS 协议主要有五部分:应用数据层协议,握

nginx负载均衡、nginx ssl原理及生成密钥对、nginx配制ssl

1.nginx负载均衡 新建一个文件:vim /usr/local/nginx/conf/vhost/load.conf写入: upstream abc_com{ ip_hash; server 61.135.157.156:80; server 125.39.240.113:80;}server{ listen 80; server_name www.abc.com; location / { proxy_pass http://abc_com; proxy_set_header Host $

webservice 采用SSL实现加密传输

本文转自:http://book.51cto.com/art/200906/129770.htm http://yeweiyun868.blog.163.com/blog/static/563784432011112985215397/ 7.9.2  采用SSL实现加密传输(1) 在默认情况下,IIS使用HTTP协议以明文形式传输数据,Web Service就是使用HTTP协议进行数据传输的.Web Service传输的数据是XML格式的明文.没有采取任何加密措施,用户的重要数据很容易被窃取,如

nginx ssl证书配置

1.Nginx安装与配置   安装pcre  #cd /usr/local/src  #yum -y install make zlib zlib-devel gcc-c++ libtool  openssl openssl-devel  #wget http://downloads.sourceforge.net/project/pcre/pcre/8.35/pcre-8.35.tar.gz  # tar zxvf pcre-8.35.tar.gz  #cd pcre-8.35  # ./co

开源项目SMSS发开指南(四)——SSL/TLS加密通信详解

本文将详细介绍如何在Java端.C++端和NodeJs端实现基于SSL/TLS的加密通信,重点分析Java端利用SocketChannel和SSLEngine从握手到数据发送/接收的完整过程.本文也涵盖了在Ubuntu系统上利用OpenSSL和Libevent如何创建一个支持SSL的服务端.文章中介绍的知识点并未全部在SMSS项目中实现,因此笔者会列出所有相关源码以方便读者查阅.提醒:由于知识点较多,分享涵盖了多种语言.预计的学习时间可能会大于3小时,为了保证读者能有良好的学习体验,继续前请先安

Nginx ssl证书部署方法

查看当前安装的OpenSSL版本所支持的密码列表,可以使用下列命令:openssl ciphers 苹果ATS检测:https://www.qcloud.com/product/ssl 刚开始"PFS(完全正向保密)"这一项未成功通过,升级Nginx版本后才通过了 具体配置方法:https://www.qcloud.com/document/product/400/6973 Nginx 证书加密套件配置: 更新Nginx根目录下 conf/nginx.conf 文件如下: server

NGINX配置HTTPS加密反向代理访问–自签CA

出于公司内部访问考虑,采用的CA是本机Openssl自签名生成的,因此无法通过互联网工信Root CA验证,所以会出现该网站不受信任或安全证书无效的提示,直接跳过,直接访问即可! HTTPS的原理和访问过程: 服务器必要条件: 一个服务器私钥 KEY文件 一张与服务器域名匹配的CA证书(公钥,根据私钥key生成) 访问过程: 1,客户端浏览器通过https协议访问服务器的443端口,并获得服务器的证书(公钥):客户端浏览器这时候会去找一些互联网可信的RootCA(权威证书颁发机构)验证当前获取到

nginx ssl 更换问题

公司之前使用的是免费startssl证书,听说IOS 以后不信任这些免费的验证不严格的证书,公司果断购买了一个统配域名证书,其实不用貌似也没什么事,主要是提交app的时候得说明理由,被拒的可能性比较大. 在更换证书前想着保留原来免费的证书,然后使用新域名做测试.结果新域名使用了新证书,测试包老是不通过 我就纳闷了~怎么就不成了,到网上搜索到的问题都是说使用的是TLS1 ,而IOS要求是TLS1.2 .但是修改nginx配置,又重新编译nginx升级openssl版本 server { liste