Add Public IP to NGINX Conf at run time

Use the following code to add dynamic IP on the NGINX configuration file


ipaddr=$(curl -s http://whatismyip.akamai.com/);
#sed -ri "s/server_name.*\$/server_name gitlab.server.my $ipaddr/" /etc/nginx/conf.d/gitlab_.conf