码迷,mamicode.com
首页 > 其他好文 > 详细

nginx后端转SSL接收前端请求

时间:2015-01-06 19:57:36      阅读:261      评论:0      收藏:0      [点我收藏+]

标签:

以下代码为nginx.conf文件内容

worker_processes  1;

events {
    worker_connections  1024;
}

http {
    # NginxHttpRealIpModule
    set_real_ip_from 10.96.0.0/16;
    set_real_ip_from 122.10.113.144;
    real_ip_header X-Real-IP;

    keepalive_timeout  65;
    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 Accept-Encoding "";
    proxy_set_header Connection "keep-alive";
    server {
        listen       443 ssl;
        ssl_certificate      cert.pem;
        ssl_certificate_key  cert.key;
        location / {
            proxy_pass http://127.0.0.1;
        }
    }

}

 

nginx后端转SSL接收前端请求

标签:

原文地址:http://www.cnblogs.com/firadio/p/4206746.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!