4

test.com/123456 にアクセスすると、nginx の URL を test://123456 などの非 http プロトコルにリダイレクトしようとしています。

次の書き換えを試みました。 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>
4

1 に答える 1