Nginx implementation of WAP mobile end and PC-side business separation

Source: Internet
Author: User
Tags nginx server user agent switcher

With the advent of the mobile Internet era, many Web sites have launched a mobile phone, the ipad and other Mobile Client page access, here describes how to use user UA to achieve user access under different terminals:

$http _user_agent is a built-in parameter for Nginx, which allows you to specify what actions the user UA will trigger when it satisfies a certain type, we take the ipad as an example, configure the phone and web-side separate access, first edit the Nginx server {} program section, Add the following information:

Location/{root/data/www/pc;                if ($http _user_agent ~ iPad) {root/data/www/mobile;     Index index.html index.htm; Reload Nginx, test time, if there is no ipad device, you can use the Firefox browser plug-in user Agent switcher to simulate a variety of devices, interested can check the usage of this plug-in

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.