NGINX distinguishes between PC and mobile to access different domain names

V Records 4,334 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, the browser jumps to the domain name

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 :

Leave a Reply

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