Get the App
SLTechnology News&Howtos  ›  Servers  › 

Nginx how to realize grayscale release according to IP

Shulou Source: shulou.com Published: 2022-05-31 20:28:13 09月22日 Update

This article mainly explains "nginx how to achieve grayscale release according to IP", interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Next let the editor to take you to learn "nginx according to IP how to achieve grayscale release" bar!

Nginx load balancer determines client IP address

If not, reverse proxy to the production environment.

Upstream prod {

Server 192.168.1.10

Server 192.168.1.11

}

Upstream pre-prod {

Server 192.168.1.100

}

Server {

Listen 80

Access_log / var/log/nginx/access.log main

Set $web_backend prod

If ($remote_addr ~ "123.123.123.123") {

Set $web_backend pre-prod

}

Location / {

Proxy_pass http://$web_backend;

Include proxy.conf

}

}

Note: the set command depends on the rewrite module.

At this point, I believe that everyone on the "nginx according to IP how to achieve gray release" have a deeper understanding, might as well to the actual operation of it! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Tags: Grayscale content learning practical deeper balanced interest command address practicality practical customer client easy to operate method more friends module environment website Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux Shulou Information Docker Xiaomi vpn