Nginx HTML content while redirect

Athlan asked:

When the redirection is configured in nginx, the response contains:

<head><title>301 Moved Permanently</title></head>[CRLF]
<body bgcolor="white">[CRLF]
<center><h1>301 Moved Permanently</h1></center>[CRLF]

while debugging:

curl -i

Can I Hide info about nginx from redirect html’s?

I have jut managed hide info about nginx by setting more_set_headers "Server: ";

My answer:

From a quick glance at the source, I think you should be able to supply your own error_page for 301, 302, 303 and 307.

error_page 301 /301.html;

location = /301.html {

(Of course, in this example /301.html must exist.)

View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.