title: Why do some servers respond with a 503 error unless my User-Agent starts with "Mozilla"?
body: <p>I'm writing a client that grabs a page from a web server. On one particular server, it would work fine from my web browser, but my code was consistently getting the response:</p>
  
  <pre><code>HTTP/1.1 503 Service Unavailable
  Content-Length:62
  Connection: close
  Cache-Control: no-cache,no-store
  Pragma: no-cache
  
  &lt;html&gt;&lt;body&gt;&lt;b&gt;Http/1.1 Service Unavailable&lt;/b&gt;&lt;/body&gt; &lt;/html&gt;
  </code></pre>
  
  <p>I eventually narrowed this down to the <strong>User-Agent</strong> header I was sending: if it contains <code>Mozilla</code>, everything is fine (I tried many variations of this). If not, I get 503. As soon as I realized it was User-Agent, I remembered having this same issue in the past (different project, different servers), but I've never figured out why. </p>
  
  <p>In this particular case, the web server I'm connecting to is running IIS 7.5, but I'm not sure if there are any proxies/firewalls/etc in front of it (I suspect there probably is something because of this behaviour).</p>
  
  <p>There's an interesting history to User-Agents which you can read about on this question:  <a href="https://stackoverflow.com/q/1114254/7913">Why do all browsers&#39; user agents start with &quot;Mozilla/&quot;?</a></p>
  
  <p>It's clearly no issue for me to have <code>Mozilla</code> in my User-Agent, but my question is simply: what is the configuration or server that causes this to happen, and why would anyone want this behaviour?</p>