# "msie\_padding on" doesn't work?

**URL:** <https://www.ruby-forum.com/t/msie-padding-on-doesnt-work/226600>\
**Category:** NGINX\
**Created:** [December 26, 2012, 4:55pm UTC](https://www.ruby-forum.com/t/msie-padding-on-doesnt-work/226600 "2012-12-26T16:55:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lorenzo\_r](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/aca169/32.png) [@lorenzo\_r](https://www.ruby-forum.com/u/lorenzo_r)\
**Post date:** [December 26, 2012, 4:55pm UTC](https://www.ruby-forum.com/t/msie-padding-on-doesnt-work/226600/1 "2012-12-26T16:55:12Z")

</div>

msie\_padding is set to on by default (and I didn’t change it). Today I  
added this line to my location php block:  
if ($http\_user\_agent ~ “MSIE 6” ) {  
return 403 “Browser not supported. Please update or change to  
another  
one.”;  
}

So now it is:  
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.”;  
}  
}

It works (with curl and a IE6 user-agent I get my custom error message),  
the problem is that IE6 (real browser) displays its default error page  
(because my message is \< of 512 bytes). But msie\_padding on should “fix”  
that, am I wrong?

If I change the error to something longer it works! For example I set  
one  
(in italian, sorry): “Internet Explorer 6.0 non e’ supportato. Per poter  
visualizzare il sito aggiorna ad una versione successiva o installa un  
browser alternativo (Google Chrome, Mozilla Firefox, Opera …).” and it  
displays my error.

---

<div class="post-metadata">

**Author:** ![lorenzo\_r](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/aca169/32.png) [@lorenzo\_r](https://www.ruby-forum.com/u/lorenzo_r)\
**Post date:** [December 26, 2012, 5:00pm UTC](https://www.ruby-forum.com/t/msie-padding-on-doesnt-work/226600/2 "2012-12-26T17:00:28Z")

</div>

On Dec 26, 2012, at 19:54 , Lorenzo R. wrote:

> ```
> 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.";

> ```
> }
> 
> ```
> 
> }
> 
> It works (with curl and a IE6 user-agent I get my custom error message), the  
> problem is that IE6 (real browser) displays its default error page (because my  
> message is \< of 512 bytes). But msie\_padding on should “fix” that, am I wrong?

No, nginx adds this padding only to its internal messages.

> If I change the error to something longer it works! For example I set one (in  
> italian, sorry): “Internet Explorer 6.0 non e’ supportato. Per poter visualizzare  
> il sito aggiorna ad una versione successiva o installa un browser alternativo  
> (Google Chrome, Mozilla Firefox, Opera …).” and it displays my error.

You create page for MSIE6:  
error\_page 402 = /msie6.html;

and return 402 error:

if ($http\_user\_agent ~ “MSIE 6”) {  
return 402;  
}
