proxy_cache_path /etc/nginx/cache keys_zone=cache:30m;
location ~* ^.+\.(jpg|jpeg|gif|png|ico|js|css|ttf|woff|woff2)$ {
rewrite ^.+\.(jpg|jpeg|gif|png|ico|js|css|ttf|woff|woff2)$ /$1 break;
proxy_pass http://127.0.0.1:8088;
proxy_cache cache;
}
http://127.0.0.1:8088/;
proxy_cache_path /etc/nginx/cache keys_zone=cache:30m;
location ~* ^.+\.(jpg|jpeg|gif|png|ico|js|css|ttf|woff|woff2)$ {
proxy_pass http://127.0.0.1:8088;
proxy_cache cache;
}
<!DOCTYPE html>
<html>
<head>
<title>Geocoding service</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<style>
/* Always set the map height explicitly to define the size of the div
* element that contains the map. */
#map {
height: 100%;
}
/* Optional: Makes the sample page fill the window. */
html, body {
height: 100%;
margin: 0;
padding: 0;
}
</style>
</head>
<body>
<div id="map"></div>
<?php
$result = db_query("SELECT value FROM webform WHERE name = 'address'")->fetchAllAssoc('value');
$json = json_encode($result);
?>
<script>
var geocoder;
var map;
var address = new Array '<?php echo $json;?>';
function initMap() {
var map = new google.maps.Map(document.getElementById('map'), {
center: new google.maps.LatLng(61.52401, 105.31875600000001),
zoom: 3
});
geocoder = new google.maps.Geocoder();
address.forEach(n => codeAddress(n, geocoder, map));
}
function codeAddress(address, geocoder, map) {
geocoder.geocode({ address }, function(results, status) {
if (status === 'OK') {
new google.maps.Marker({
map: map,
position: results[0].geometry.location,
title: address
});
} else {
alert('Geocode was not successful for the following reason: ' + status);
}
});
}
</script>
<script async defer
src="https://maps.googleapis.com/maps/api/js?key=API-KEY&callback=initMap">
</script>
</body>
</html>