我想在nginx的一个URL重定向到一个非HTTP协议如测试:// 123456当我去test.com/123456如何重定向nginx的非HTTP没有HTML头
我已经试过以下重写: 重写^/$试验(*):// $ 1稳定;
和它的作品不过怪异的一部分,它增加HTML /身体头,其弄乱我的代码,有什么办法没有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>