function createProxyConfig( proxy, curConfig ) {
	const proxyMarkup = [];

	// the number of spaces in the proxy markpu is intended
	proxyMarkup.push( 'location @production {' );
	proxyMarkup.push( '    resolver 8.8.8.8;' );
	proxyMarkup.push( '    proxy_ssl_server_name on;' );
	proxyMarkup.push( `    proxy_pass ${ proxy }/$uri;` );
	proxyMarkup.push( '}' );

	const proxyMapObj = {
		'#{TRY_PROXY}': 'try_files $uri @production;',
		'#{PROXY_URL}': proxyMarkup.join( os.EOL ),
	};

	const re = new RegExp( Object.keys( proxyMapObj ).join( '|' ), 'gi' );
	const newConfig = curConfig.replace( re, function( matched ) {
		return proxyMapObj[matched];
	} );

	return curConfig.replace( curConfig, newConfig );
}
Create the NGINX directive to set a media URL proxy

@param {string} proxy The URL to set the proxy to
@param {string} curConfig  content of the existing config file
@return {string} New content for the config file