title: How to Preventing Host Header Attack in Ubuntu Server 14.04
body: <p>If we send a request from any host like example.com our server gives back a HTTP 1.1 200 OK response status.</p>
  
  <p>In correct condition it should show either 302, 400 or 404 error message (not found response) status. At current condition it is showing 200 OK response message, when its send through our host like xx.xxx.xx.xx.</p>
  
  <p>For example, if we sent this request:</p>
  
  <blockquote>
    <p>GET /web/ HTTP/1.1 <strong>Host: example.com</strong> User-Agent: Mozilla/5.0 (Windows
    NT 10.0; WOW64; rv:51.0) Gecko/20100101 Firefox/51.0 Accept:
    text/html,application/xhtml+xml,application/xml;q=0.9,<em>/</em>;q=0.8
    Accept-Language: en-US,en;q=0.5 Connection: close
    Upgrade-Insecure-Requests: 1</p>
  </blockquote>
  
  <p>We get this response:</p>
  
  <blockquote>
    <p><strong>HTTP/1.1 200 OK</strong> Date: Thu, 02 Mar 2017 15:23:20 GMT Server:
    figi_Server X-Frame-Options: deny Strict-Transport-Security: 1 Vary:
    Accept-Encoding X-Content-Type-Options: nosniff X-Frame-Options:
    sameorigin X-XSS-Protection: 1; mode=block</p>
  </blockquote>
  
  <p>Using </p>
  
  <pre><code>OS: Ubuntu 14.04.
  Web server: Apache 2.2.
  Virtual machine running both.
  </code></pre>
  
  <p>Please go through Screen Shot Of Issue for better Understanding of Issue:</p>
  
  <p><a href="https://i.stack.imgur.com/1FIwv.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1FIwv.jpg" alt="enter image description here"></a></p>