Home  >  Q&A  >  body text

vue.js - nginx determines whether the IE browser is below 10. http_user_agent rewrites to a page prompt.

Vue used by the company. Single page...

vue does not support browsers below ie9.

All I want is for nginx to determine whether it is IE. And the version is lower than 10. Then I rewrite to another page...

But it never succeeded.. To facilitate testing. I changed the condition to ie

if ($http_user_agent ~ "MSIE") {
        rewrite /message.html break;
}

There is a message page in the project root directory, prompting the user to switch to an advanced browser or upgrade.

But this did not succeed!!!!!

history mode used by vue

淡淡烟草味淡淡烟草味2714 days ago1238

reply all(2)I'll reply

  • 大家讲道理

    大家讲道理2017-05-16 17:09:35

    I personally think this should be done on the front end. Before each entry to the homepage, a vue routing navigation hook function will be sentbeforeRouteEnter , and then it will be judged here whether it is IE. And the version is lower than 10, if so, jump directly Redirect to another page

    reply
    0
  • 滿天的星座

    滿天的星座2017-05-16 17:09:35

    It is safest to write directly in index.html or use native JS. . .

      <body>
        <!--[if lt IE 9]><p style="color:red">你的浏览器实在<strong>太太太太太太旧了</strong>,放学别走,升级完浏览器再说 <a target="_blank" class="alert-link" href="http://browsehappy.com">立即升级</a></p><![endif]-->
        <p id="app"></p>
        <!-- built files will be auto injected -->
      </body>

    reply
    0
  • Cancelreply