【问题标题】:Nginx rule for redirecting http://www.example.com/test to test.domain.com用于将 http://www.example.com/test 重定向到 test.domain.com 的 Nginx 规则 【发布时间】:2015-11-16 19:15:28 【问题描述】: 我需要一些帮助来编写用于将子文件夹重定向到子域的 nginx 规则,如下所示 http://www.example.com/test 到 test.domain.com 谢谢 【问题讨论】: nginx - redirect a certain path to another domain的可能重复 标签: php nginx url-rewriting 【解决方案1】: 如果您在 www.example.com 虚拟主机中,只需在配置中写下这一行: rewrite ^/test http://test.domain.com; 【讨论】: