首页 > 系统相关 >内网nginx代理高德问题

内网nginx代理高德问题

时间:2024-04-07 17:22:44浏览次数:15  
标签:http sub 191.145 18090 filter nginx 内网 高德 15.72

A为外网服务器

B为内网服务器
nginx配置

    server {
        listen       8081;
        server_name  15.72.185.21;
	location /webapi/ {
        proxy_pass http://15.72.191.145:18090/;
	}
	location /restapi {
	    proxy_pass http://15.72.191.145:18090/restapi/;
	}
    location /maps {
        proxy_set_header Accept-Encoding "";
        proxy_pass http://15.72.191.145:18090/maps/;
        sub_filter_types *;
        sub_filter_once off;
        sub_filter 'http://webapi.amap.com' 'http://15.72.191.145:18090/webapi';
        sub_filter 'https://webapi.amap.com' 'http://15.72.191.145:18090/';
        sub_filter 'http://restapi.amap.com' 'http://15.72.191.145:18090/restapi';
        sub_filter 'http://vdata.amap.com' 'http://15.72.191.145:18090/vdata';
        sub_filter 'vdata.amap.com' '15.72.191.145:18090/vdata';
        sub_filter 'vdata0{1,2,3,4}.amap.com' '15.72.191.145:18090/vdata0{1,2,3,4}';
        sub_filter '{vdata,vdata01,vdata02,vdata03,vdata04}.amap.com' '15.72.191.145:18090/{vdata,vdata01,vdata02,vdata03,vdata04}';
        sub_filter 'webapi.amap.com/count' '15.72.191.145:18090/count';
        sub_filter 'wprd0{1,2,3,4}.is.autonavi.com' '15.72.191.145:18090/wprd0{1,2,3,4}';
        sub_filter 'webapi.amap.com/theme' '15.72.191.145:18090/theme';
        sub_filter 'restapi.amap.com/v4' '15.72.191.145:18090/restapi/v4';
        sub_filter 'webapi.amap.com/style' '15.72.191.145:18090/style';
	    sub_filter 'https' 'http';
	}
	location /vdata {
            proxy_pass http://15.72.191.145:18090/vdata/;
	}
	location /vdata01 {
            proxy_pass http://15.72.191.145:18090/vdata01/;
	}
	location /vdata02 {
            proxy_pass http://15.72.191.145:18090/vdata02/;
	}
        location /vdata03 {
            proxy_pass http://15.72.191.145:18090/vdata03/;
        }
        location /vdata04 {
            proxy_pass http://15.72.191.145:18090/vdata04/;
        }

    }

webapi注意 / ,可能是我对nginx的location匹配规则还不熟悉,大坑,目前这么配置是能成功访问高德的

标签:http,sub,191.145,18090,filter,nginx,内网,高德,15.72
From: https://www.cnblogs.com/yuan9910/p/18119485

相关文章

  • Nginx日志重定向到标准输出
    背景静态站点使用`docker`部署时,希望`nginx前台启动`的同时可以将错误日志和访问日志全部重定向到标准输出,便于采集和处理!实现只需要修改`nginx.conf`中`3行`关于日志的配置就OK了daemonoff;error_log/dev/stdoutwarn;access_log/dev/stdoutmain;其它配置项保持不变,效果......
  • Nginx 1.25.4 编译安装
    Nginx1.25.4源码编译安装最新长期技术支持版本 nginx-1.25.4,官方下载源码包: https://nginx.org/download/nginx-1.25.4.tar.gz一键安装脚本不啰嗦,脚本简单快速编译安装#!/bin/bash#安装相关包yum-yinstallgccpcre-developenssl-develzlib-develmakewget#......
  • nginx详解
    Nginx安装配置详解Nginx简介Nginx(“enginex”)是一款高性能的Web服务器和反向代理服务器,它采用事件驱动的异步结构,具有内存占用少、稳定性高、能够处理大量的并发请求,具有高效和低资源消耗等特点。Nginx常常被用作Web服务器、负载均衡器、反向代理和缓存服务器等。Nginx安装......
  • nginx怎么设置拦截请求
    Nginx设置拦截请求可以通过多种方式实现,具体取决于您想要拦截的请求类型、条件以及拦截后的处理方式。以下是几种常见的拦截请求场景及其配置方法:1.基于IP地址的拦截可以使用 allow 和 deny 指令来允许或拒绝特定IP地址或IP段的访问。通常放在 http, server,或 l......
  • docker-compose 安装nginx
    docker-compose.yamlversion:'3.3'services:nginx:image:nginxrestart:alwayshostname:nginxcontainer_name:nginxprivileged:trueports:-80:80-443:443volumes:-./nginx/conf/:/etc/nginx/......
  • java中大型医院HIS系统源码 Angular+Nginx+SpringBoot云HIS运维平台源码
    java中大型医院HIS系统源码Angular+Nginx+SpringBoot云HIS运维平台源码云HIS系统是一款满足基层医院各类业务需要的健康云产品。该产品能帮助基层医院完成日常各类业务,提供病患预约挂号支持、病患问诊、电子病历、开药发药、会员管理、统计查询、医生工作站和护士工作站等一......
  • nginx同一端口配置代理不同路径下的文件
    需求如下:CMS系统后台通过freemarker模板生成静态html文件,主站点和子站点的html文件保存在不同文件夹下。根据站点ID分别保存到不同文件夹,结构如下:  其中,75为主站点,111为子站点b。通过nginx配置,在同一域名下根据不同路径访问不同站点html。  实现访问www.xxx.com访问......
  • nginx反向代理实现不同域名映射到同一台服务器的相同端口
    在实际应用中,我们经常会遇到多个域名需要映射到同一台服务器的相同端口的情况,这时可以使用nginx反向代理来实现。以实现将www.example.com和www.test.com都映射到127.0.0.1的80端口为例,具体步骤如下:修改hosts文件在本地hosts文件中添加以下两行:127.0.0.1www.example.com12......
  • VM虚拟机部署code-server服务+tailscale内网穿透,实现随处coding
    1.Linux下安装code-serverReleases·coder/code-server(github.com)https://github.com/coder/code-server/releases先去发布页面查看最新的code-server版本,下载命令示例:wgethttps://github.com/coder/code-server/releases/download/v4.22.1/code-server_4.22.1_amd64.d......
  • frp内网穿透:基于centos8 云服务器和debian12客户端服务器
    前言入了一台本地工控机盒子,刷成了debian12系统,性能比云服务器要好一点,现在想要远程访问这台盒子,但是盒子又没有公网地址,所以想通过内网穿透的方式,通过云服务器转发请求实现内网穿透。原来体验了一下花生壳,感觉比较麻烦,于是还是想到了使用frp实现。现在记录下具体流程留作后续参......