> We have a website under heavily development. So we divide the site to 3 branches stage, demo and main. What our developers want from me is : "every request from office ip address to main domain must redirect to stage."
If there is a single IP you can use the if directive (http://nginx.org/en/docs/http/ngx_http_rewrite_module.html#if ) in case of multiple - map (http://nginx.org/en/docs/http/ngx_http_map_module.html ) or geo will be a better approach.
A generic example with if:
if ($remote_addr = 127.0.0.1) {
return 301 http://stage.aaa.com$request_uri;
}
rr
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx