当前位置: 首页 > news >正文

优化前网站现状分析百度引擎入口官网

优化前网站现状分析,百度引擎入口官网,企业邮箱注册申请免费注册,企业网站做的漂亮解决场景:下载发票的版式文件,第三方返回的是url链接地址,但是服务是部署在内网环境,无法访问互联网进行下载。此时需要进行走反向代理出去,如果按照已有套路,就是根据不同的访问前缀,跳转不同的…

解决场景:下载发票的版式文件,第三方返回的是url链接地址,但是服务是部署在内网环境,无法访问互联网进行下载。此时需要进行走反向代理出去,如果按照已有套路,就是根据不同的访问前缀,跳转不同的location,我们有四十几个路径,就需要配置40多个location ,比较繁琐。此时可以使用nginx里的map 属性,进行配置,配置如下:

nginx配置文件


#user  nobody;
worker_processes  6;#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;#pid        logs/nginx.pid;events {worker_connections 65535 ;
}http {include       mime.types;default_type  application/octet-stream;#log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '#                  '$status $body_bytes_sent "$http_referer" '#                  '"$http_user_agent" "$http_x_forwarded_for"';#access_log  logs/access.log  main;sendfile        on;#tcp_nopush     on;#keepalive_timeout  0;keepalive_timeout  120s;#gzip  on;# 增大 map_hash_bucket_size 的值,可以根据实际情况调整大小map_hash_bucket_size 200;  # 定义映射关系map $http_x_target_server $target_server {default         "";"pubapi.jcsk100.com"                 "https://pubapi.jcsk100.com";"rocgw.jcsk100.com"                  "https://rocgw.jcsk100.com/external/";"taxsapivip.jcsk100.com"             "https://taxsapivip.jcsk100.com/v1/api/s";"taxsapi.holytax.com"                "https://taxsapi.holytax.com/v1/api/s";"dppt.shanghai.chinatax.gov.cn"      "https://dppt.shanghai.chinatax.gov.cn:8443";"dppt.guangdong.chinatax.gov.cn"     "https://dppt.guangdong.chinatax.gov.cn:8443";"dppt.xiamen.chinatax.gov.cn"        "https://dppt.xiamen.chinatax.gov.cn:8443";"dppt.tianjin.chinatax.gov.cn"       "https://dppt.tianjin.chinatax.gov.cn:8443";"dppt.chongqing.chinatax.gov.cn"     "https://dppt.chongqing.chinatax.gov.cn:8443";"dppt.neimenggu.chinatax.gov.cn"     "https://dppt.neimenggu.chinatax.gov.cn:8443";"dppt.dalian.chinatax.gov.cn"        "https://dppt.dalian.chinatax.gov.cn:8443";"dppt.qingdao.chinatax.gov.cn"       "https://dppt.qingdao.chinatax.gov.cn:8443";"dppt.shaanxi.chinatax.gov.cn"       "https://dppt.shaanxi.chinatax.gov.cn:8443";"dppt.sichuan.chinatax.gov.cn"       "https://dppt.sichuan.chinatax.gov.cn:8443";"dppt.henan.chinatax.gov.cn"         "https://dppt.henan.chinatax.gov.cn:8443";"dppt.fujian.chinatax.gov.cn"        "https://dppt.fujian.chinatax.gov.cn:8443";"dppt.jilin.chinatax.gov.cn"         "https://dppt.jilin.chinatax.gov.cn:8443";"dppt.yunnan.chinatax.gov.cn"        "https://dppt.yunnan.chinatax.gov.cn:8443";"dppt.ningbo.chinatax.gov.cn"        "https://dppt.ningbo.chinatax.gov.cn:8443";"dppt.shenzhen.chinatax.gov.cn"      "https://dppt.shenzhen.chinatax.gov.cn:8443";"dppt.gansu.chinatax.gov.cn"         "https://dppt.gansu.chinatax.gov.cn:8443";"dppt.shanxi.chinatax.gov.cn"        "https://dppt.shanxi.chinatax.gov.cn:8443";"dppt.zhejiang.chinatax.gov.cn"      "https://dppt.zhejiang.chinatax.gov.cn:8443";"dppt.hainan.chinatax.gov.cn"        "https://dppt.hainan.chinatax.gov.cn:8443";"dppt.liaoning.chinatax.gov.cn"      "https://dppt.liaoning.chinatax.gov.cn:8443";"dppt.jiangsu.chinatax.gov.cn"       "https://dppt.jiangsu.chinatax.gov.cn:8443";"dppt.jiangxi.chinatax.gov.cn"       "https://dppt.jiangxi.chinatax.gov.cn:8443";"dppt.guangxi.chinatax.gov.cn"       "https://dppt.guangxi.chinatax.gov.cn:8443";"dppt.hebei.chinatax.gov.cn"         "https://dppt.hebei.chinatax.gov.cn:8443";"dppt.heilongjiang.chinatax.gov.cn"  "https://dppt.heilongjiang.chinatax.gov.cn:8443";"dppt.xinjiang.chinatax.gov.cn"      "https://dppt.xinjiang.chinatax.gov.cn:8443";"dppt.hubei.chinatax.gov.cn"         "https://dppt.hubei.chinatax.gov.cn:8443";"dppt.beijing.chinatax.gov.cn"       "https://dppt.beijing.chinatax.gov.cn:8443";"dppt.anhui.chinatax.gov.cn"         "https://dppt.anhui.chinatax.gov.cn:8443";"dppt.shandong.chinatax.gov.cn"      "https://dppt.shandong.chinatax.gov.cn:8443";"dppt.hunan.chinatax.gov.cn"         "https://dppt.hunan.chinatax.gov.cn:8443";"dppt.guizhou.chinatax.gov.cn"       "https://dppt.guizhou.chinatax.gov.cn:8443";"dppt.xizang.chinatax.gov.cn"        "https://dppt.xizang.chinatax.gov.cn:8443";"dppt.ningxia.chinatax.gov.cn"       "https://dppt.ningxia.chinatax.gov.cn:8443";"dppt.qinghai.chinatax.gov.cn"       "https://dppt.qinghai.chinatax.gov.cn:8443";}#代理地址server {listen  8444;location  / {# 响应头打印 $http_x_target_server 和 $target_server 的值add_header X-Target-Server $http_x_target_server;add_header Target-Server $target_server;# 默认不传给北京的地址if ($target_server = "") {set $target_server "https://dppt.beijing.chinatax.gov.cn:8443";}proxy_pass $target_server;proxy_cache off;proxy_redirect off;proxy_connect_timeout 5m;proxy_send_timeout 5m;proxy_read_timeout 5m;proxy_buffer_size 10m;proxy_buffers 256 10m;proxy_busy_buffers_size 10m;proxy_temp_file_write_size 10m;add_header Cache-Control no-cache;proxy_set_header X-Real-IP $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;}}# 添加 resolver 指令,使用 Google 的公共 DNS 服务器,根据项目上的情况进行配置,使用$target_server必须配置,写死地址则不需要resolver 8.8.8.8;
}

Java代码:

            // header 传入nginx里的key即可 就会指定到对应的目标server里URL url = new URL(urlString);URLConnection connection = url.openConnection();connection.setRequestProperty("X-Target-Server", header);

验证方式:
在这里插入图片描述
可以在响应头中,查看具体访问的代理地址。

http://www.mmbaike.com/news/67971.html

相关文章:

  • 郑州做网站九零后网络站长查询
  • 学习网页设计的网站域名查询备案
  • 华安网站建设排名怎么优化快
  • 世界顶级网站设计微信营销号
  • 网站建设规划方案搜狗收录提交
  • 网站后台界面设计网站推广公司哪家好
  • 建动画网站需要多少钱1元涨1000粉
  • 青岛网站建设公司正百度信息流怎么做效果好
  • iis 网站设置百度搜索引擎投放
  • 法律对网站建设的规制网站推广的概念
  • 公司的网站建设费用属于什么费如何推广一个项目
  • wordpress百度百科seo站长工具
  • 独立站做deal网站域名邮箱 400电话
  • 自己做的网站怎么置顶app下载推广平台
  • python做的网站如何部署东莞网站优化公司
  • 济南网站建设联系小七百度云盘搜索引擎入口
  • 网站做cdn需要注意什么2345网址导航下载
  • 网站专题页面设计规范站长工具seo查询
  • 泉州模板建站公司seo在线优化工具
  • 哪个网站可以用来做读书笔记海口关键词优化报价
  • 做网站为什么要钱湖南seo推广服务
  • 网站模板库软件今天发生的重大新闻内容
  • 专门做外卖的网站最打动人心的广告语
  • 西宁做网站的好公司seo优化资源
  • 渭南房产网站制作免费网站流量统计
  • vue.js合作做网站么如何免费创建自己的平台
  • 网站图片alt属性设置营销策略有哪些理论
  • 西安市网站建设公司程序员培训
  • 外贸b2c哪个网站好佛山seo培训
  • 手机制作ppt哪种软件好上海网站排名seo公司