当我转到 test.com/123456 时,我正在尝试将 nginx 中的 url 重定向到非 http 协议,例如 test://123456
我尝试了以下重写:rewrite ^/(.*)$ test://$1 Permanent;
但是它的工作原理是它添加了 html/body 标头的奇怪部分,这会弄乱我的代码,没有 html 标头或任何其他推荐的重写方法有什么办法吗?
HTTP/1.1 301 Moved Permanently
Server: nginx/1.1.19
Date: Tue, 30 Apr 2013 14:14:47 GMT
Content-Type: text/html
Content-Length: 185
Connection: keep-alive
Location: test://123456
<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx/1.1.19</center>
</body>
</html>