因此,curl -i http://example.com
在我的服务器上执行操作时,我在正文中收到以下响应:
<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx</center>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
它显示我正在运行 nginx,我想删除此信息。
这是我的 nginx.conf 重定向到 HTTPS(以及我尝试更改 301 响应正文):
server {
listen 80;
server_name localhost;
error_page 301 = /301.html;
location /301.html {
return 301 "<h1>use https</h1>";
}
return 301 https://$host$request_uri;
}
Run Code Online (Sandbox Code Playgroud)
知道如何更改 301 响应正文吗?