# nginx 443
server {
  # listen 80; # 要让https和http并存,去掉注释80,要注释:ssl on;
  listen 443 ssl;
  server_name wx2.juvv.com;
  ssl on;     
  root html;
  index index.html index.htm;
  ssl_certificate   ../conf/cert/3808487_wx2.juvv.com.pem;
  ssl_certificate_key  ../conf/cert/3808487_wx2.juvv.com.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;
  #HTTP_TO_HTTPS_START     # 要让https和http并存,此块注释
    if ($server_port !~ 443){
        rewrite ^(/.*)$ https://$host$1 permanent;
  }
  #HTTP_TO_HTTPS_END
  location / {
     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_pass http://172.19.18.39:6102;
    }
}
        
# 设置80跳转443       
server {
   listen 80;
   server_name example.com www.example.com;
   #return 301 https://$host$request_uri;
   rewrite ^(.*)$ https://$host$1  permanent;
}


签名:这个人很懒,什么也没有留下!
最新回复 (0)
返回