Problem title, use the following code to jump to the specified server
rewrite ^/(.*)$ http://xxxx.cn/index.php?id=/$1 permanent;
Now, want to jump to the server in getting this nginx server IP address, using PHP, commonly used to get the code seems to get not, ask whether there is a way to get to?
$ip = $_server["REMOTE_ADDR"];
Echo $ip;
?>
Reply content:
Problem title, use the following code to jump to the specified server
rewrite ^/(.*)$ http://xxxx.cn/index.php?id=/$1 permanent;
Now, want to jump to the server in getting this nginx server IP address, using PHP, commonly used to get the code seems to get not, ask whether there is a way to get to?
$ip = $_server["REMOTE_ADDR"];
Echo $ip;
?>
Nginx rewrite
is an HTTP redirect that notifies the browser to request a new address, which you can pass through a cookie or URL to the server you want to jump to.