前端高德地图无法地图选点
Nginx直接拦截/amap转发(转发地址为当前使用的高德API版本地址)
server {
listen 80;
server_name www.test.com;
client_max_body_size 1024M;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_redirect off;
proxy_connect_timeout 900;
proxy_send_timeout 900;
proxy_read_timeout 900;
proxy_pass http://192.168.3.117:9094;
}
//代理高德API
location /amap {
proxy_pass https://restapi.amap.com/v3/geocode/;
}
}