解决https redirect 后变 http 的问题

  server {

    listen 80;
listen 443 ssl;
    server_name ;

    # 错误页面
    error_page  404 403 500 502 503 504  /404.html;

ssl_certificate   ;
    ssl_certificate_key  ;
    ssl_session_timeout 5m;
    ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_prefer_server_ciphers on;
    location / {

        proxy_pass  https:///; 
    ##    proxy_redirect   default ;
        proxy_redirect   http:// https://;  #跳转到https
proxy_set_header Host $host;   #隐藏ip
proxy_set_header X-Real-IP $remote_addr;  #隐藏ip
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;  #隐藏ip
}
}

你可能感兴趣的:(解决https redirect 后变 http 的问题)