I noticed that when I create a 301 redirection using nginx (rewrite, return 301), I get the following HTML body:
<html>
<head><title>301 Moved Permanently</title></head>
<body>
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx</center>
</body>
</html>
I would like to get rid of the HTML body of this 301 redirect generated by Nginx. Facebook and twitter got rid of those HTML bodies of their 301 redirect long time ago. It is a way to save some unsolicited bytes during 301 redirects.
So, I guess it is possible to create the HTTP header fields of the 301 redirect manually without calling rewrite or return 301. If I call "rewrite" or "return 301" in a location block of nginx, it will also generate the HTML body that I don't want. I can't modify the configuration files because I use Plesk. The Nginx configuration files are automatically generated.
So, I guess it is possible to manually create the following HTTP header fields with NGINX in a location block:
HTTP/1.1 301 Moved Permanently
Server: nginx
Date: Tue, 15 Sep 2020 17:48:13 GMT
Content-Type: text/html
Content-Length: 162
Connection: keep-alive
Location: https://bloup.com/
How would you do it?