Cannot detect Browser when using Elastic Load Balancer

Viewed 59

I want to prevent users from using my website in Internet Explorer.

What I want to do is to detect their browser on the server side, and if it is Internet Explorer, I would redirect them to a page, saying "IE is not supported"

I have tried detecting browser using both Browser and UserAgent, in the development environment, I get the following values:

var browser = HttpContext.Current.Request.Browser;     // <-- InternetExplorer
var userAgent = HttpContext.Current.Request.UserAgent; // <-- Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko

But when I run the same code in my test environment (test server is behind Application Load Balancer) I get the following values:

var browser = HttpContext.Current.Request.Browser;     // <-- Unknown
var userAgent = HttpContext.Current.Request.UserAgent; // <-- ELB-HealthChecker/2.0 

Is there any way that I could detect the browser behind ELB?

0 Answers
Related