If it would be so trivial/easy then devs would only release a one-fits-all version that install on every Unix/Linux/BSD/Windows. There are too many differences between the distros.
On RHEL/Centos you'll first need to add EPEL and then use yum. On Debian systems you could use apt-get. BSD/Solaris/Busybox are different too.
Additionally, you need to configure the distro to start nginx after boot automatically and while you're at it, let TCP traffic through the firewall too.
Calling home is easy with curl (for which you need to check too and install it if it's missing (what I said about installing nginx applies here too)). You would not need a server_ip parameter (which you would need to get in different ways on the distros) since your server logs the requesting IP.
The nginx config isn't the big problem; iirc it's something along those lines:
server {
listen 80;
location / {
proxy_pass http://your.server.ip:80;
}
}
Last but not least: You're assuming that each of them runs bash.