fix for bug in jfryman puppet-nginx https://github.com/jfryman/puppet-nginx/issues/322
also sanitize locations with a ~ in them