1.推荐配置

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

server {
       listen         443 ssl;
       server_name    example1.com example2.com;
       ...
}

2.为什么使用$host

  • $host is used instead of $server_name to properly match between server block the corresponding domains

3.照搬链接

相关文章:

  • 2021-11-07
  • 2022-12-23
  • 2021-12-13
  • 2021-08-29
  • 2022-12-23
  • 2021-06-04
  • 2021-07-26
猜你喜欢
  • 2022-02-19
  • 2021-09-21
  • 2022-02-06
  • 2021-08-03
  • 2021-07-23
  • 2021-05-26
  • 2021-08-23
相关资源
相似解决方案