0

The following conditional when matching a user-agent with substring 'MSIE 8' causes a 404 redirect?

 #Begin IE8 Hack
 if ($http_user_agent ~* 'MSIE 8') {
     #set $hack "I";
 }
 #End IE8 Hack

Commenting out the if ($http_user_agent... stops the 404 redirect.

Whats going on here?

Curl Request

curl -XGET 'https://localhsot/[email protected]' -v -A'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; MDDSJS)'

Environment

  • NGINX 1.6.2
  • Linux Debian 7 3.2.0-4-amd64

Full Configuration

server {

listen 80 default_server;

root /var/www/frontend;

#Begin IE8 Hack
error_page               418 = @PATCH;
location @PATCH {
  proxy_method          PATCH;
  proxy_pass            http://0.0.0.0:3001;
  proxy_redirect        default;
}
#End IE8 Hack

location / {
  #Begin IE8 Hack
  if ($http_user_agent ~* 'MSIE 8') {
    #set $hack "I";
  }
  #if ($request_method = PUT) {
  #   set $hack "${hack}E";
  #}
  #if ($hack = IE) {
  #   return 418;
  #}
  #End IE8 Hack

  proxy_pass            http://0.0.0.0:3001/v1/;
  proxy_redirect        default;
 }
}
2

0

You must log in to answer this question.

Browse other questions tagged .