第一种:通过正则匹配所有的URI后再去掉开头第一个/(反斜线)。

  rewrite ^/(.*)$ https://www.xxxx.com/$1;

第二种:通过$request_uri变量匹配所有的URI。

rewrite ^ https://www.xxxx.com$request_uri? permanent;

第三种:使用return指令,通过301状态码和$request_uri参数(推荐)

return 301 https://www.xxxx.com$request_uri;

参考说明:
nginx 三种重定向

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-29
  • 2022-01-10
  • 2021-06-09
  • 2021-12-02
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-28
  • 2021-09-01
  • 2021-10-19
  • 2020-07-21
  • 2021-07-28
  • 2021-06-29
  • 2022-12-23
相关资源
相似解决方案