NGINX distinguishes between PC and mobile to access different domain names

V Records 2,123 Views , No comment

When the PC and mobile phones need to access different domain names, we can distinguish different clients through Nginx.
By adding a jump to the Nginx configuration file, use user-agent to determine whether the client is mobile or PC:

In this way, when the mobile terminal accesses the domain name www.nginxer.com, the browser jumps to the domain name mobile.nginxer.com.

redirect means 302 jump (temporary transfer)
permanent means 301 jump (permanent transfer).


This article was first published by V on 2018-11-08 and can be reprinted with permission, but please be sure to indicate the original link address of the article :http://www.nginxer.com/records/nginx-distinguishes-between-pc-and-mobile-to-access-different-domain-names/

Leave a Reply

Your email address will not be published. Required fields are marked *

Go