在网站启用https之后,我们可能会有一个需求,就是将所有的http的请求自动地重定向到https,

  如果前端是使用的nginx来实现的https,我们可以这样配置nginx的301重定向:

server {  listen	  80;  server_name    xxx.com;  return	  301 https://$server_name$request_uri;
}

server {  listen	  443 ssl;  server_name    xxx.com.com;  [....]
}

相关文章:

  • 2021-06-22
  • 2021-11-19
  • 2022-12-23
  • 2021-12-03
  • 2021-08-18
  • 2021-12-03
  • 2021-06-04
猜你喜欢
  • 2021-11-01
  • 2021-11-22
  • 2021-07-08
  • 2022-12-23
  • 2021-12-22
  • 2022-12-23
  • 2022-01-10
相关资源
相似解决方案