<div dir="ltr"><div>Hello!</div><div><br></div><div>I'm trying to</div><div>1. send people to home page if they enter wrong place (404)</div><div>2. it works, but HTML content with headers is:</div><div><div><br></div><div>HTTP/1.1 302 Moved Temporarily</div><div>Server: nginx/1.10.3</div><div>Date: Thu, 23 Mar 2017 11:38:08 GMT</div><div>Content-Type: text/html</div><div>Content-Length: 161</div><div>Location: <a href="http://mysite/myhomepage.html">http://mysite/myhomepage.html</a></div><div>Connection: keep-alive</div><div><br></div><div><html></div><div><head><title>302 Found</title></head></div><div><body bgcolor="white"></div><div><center><h1>302 Found</h1></center></div><div><hr><center>nginx/1.10.3</center></div><div></body></div><div></html></div></div><div><br></div><div><br></div><div>Is it possible to send custom page content?</div><div><br></div><div>My config:</div><div><br></div><div><div>server {</div><div><span style="white-space:pre"> </span>listen 80;</div></div><div> root /somewhere/mysite;</div><div><div><span style="white-space:pre"> </span>location @redirect_to_home {<br></div><div><span style="white-space:pre"> </span>error_page<span style="white-space:pre"> </span>302 /custom_302_page.html;</div><div><span style="white-space:pre"> </span>return 302 /myhomepage.html;</div><div><span style="white-space:pre"> </span>}</div><div><span style="white-space:pre"> </span>error_page<span style="white-space:pre"> </span>404<span style="white-space:pre"> = </span>@redirect_to_home;</div></div><div>}</div><div><br></div><div><br></div><div>Thanks for the advise!</div><div><br></div>
</div>