qiangyuzhou

https配置:


 

nginx配置

server {
listen 443;
server_name localhost;
ssl on;
root html;
index index.html index.htm;
ssl_certificate cert/a.pem;
ssl_certificate_key cert/a.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 / {
root html;
index index.html index.htm;

 


 

http 强制转换https


    在配置文件中加入下面代码

server {

    ...

 

    if ($server_port = 80){ 

return 301 https://$server_name$request_uri;} 

 

if ($scheme = http){ 

return 301 https://$server_name$request_uri;} 

    ....

}

 

分类:

技术点:

相关文章:

  • 2021-11-21
  • 2021-11-21
  • 2021-11-21
  • 2021-11-21
  • 2021-07-18
  • 2021-10-20
  • 2021-11-21
  • 2021-10-05
猜你喜欢
  • 2021-11-21
  • 2021-11-21
  • 2021-09-13
  • 2021-11-21
  • 2021-11-21
  • 2021-11-21
  • 2021-08-18
相关资源
相似解决方案