title: Nginx: return error 403 and display a message
body: <p>I'd like nginx to return an error 403 if user-agent is MSIE 6 and to display a custom error message.
  I used this code and everything worked the first minutes. Then it just returned the error without the message! Don't know why...
  Here's the code (I tried to put ' instead of ", to have plain text without ' or ", still no luck):</p>
  
  <pre><code>location ~ \.php$ {
      try_files $uri =404;
      fastcgi_split_path_info ^(.+\.php)(/.+)$;           
      include /etc/nginx/fastcgi.conf;
      fastcgi_pass unix:/var/run/php5-fpm.sock;
      if ($http_user_agent ~ "MSIE 6" ) {
        return 403 "Browser not supported. Please update or change to another one.";
      }
  }
  </code></pre>
  
  <p>EDIT: Forgot to say that it's in the php block because I want to block MSIE 6 only for PHP requests.</p>