redirect to another domain based on IP address

Patrick 201904-nginx at
Mon May 6 14:12:53 UTC 2019

On 2019-05-06 16:47, ender ulusoy wrote:
> Main office ip
> And it's shared office. I can not setup any dns services there. All
> the developers come from this ip.

map $remote_addr $is_web_dev  {  1;
	default  0;

server {

	if ($is_web_dev) {
		return 301$uri ;
	# rest of normal prod config

This config is probably going to cause something to blow up in the
future because it is not doing what the user requested -- if the user
wanted staging they should have just used in the
first place.


More information about the nginx mailing list