Nginx sets a whitelist based on the end number of the website user
Source: Internet
Author: User
Nginx sets the whitelist www.2cto.com based on the end number of the website user. In fact, this requirement is very common. a new function is developed. First, you need to test run the function on the website. Therefore, you need to set a whitelist switch, there are many implementation methods. here we will talk about how to implement it using nginx: getting cookies...
Nginx sets the white list www.2cto.com by the end number of the website user. In fact, this requirement is very common. it is a new function that needs to be developed. First, you must test run on the website.
There are many implementation methods to implement a white list switch. here we will talk about how to implement it in nginx: get the user ID in the cookie, and then set the White List user ID in the white list. You can use the map module in nginx to retrieve the id from the cookie. you can use $ COOKIE_id, where map $ COOKIE_id $ flag {~ * 4 true ;~ * 1 true; default false;} www.2cto.com originally said that this method can add users whose user tail number is 4 and 1 to the White List (perform corresponding processing based on $ flag being true or false) but I tried TM for a long time today and it never worked .... The nginx version will be changed from 0.85 to 1.08, so now I can only say this: "This function is not available in previous versions of the nginx map module, later versions add this feature. "mark it first.
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