nginx后端转SSL接收前端请求

以下代码为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;
        }
    }

}
飞儿传媒www.firadio.com
原文地址:https://www.cnblogs.com/firadio/p/4206746.html