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

js做各类图表网站网站快照优化公司

js做各类图表网站,网站快照优化公司,新品发布会主题大全,做网站需要知道的问题Nginx 是一个高性能的开源反向代理服务器,可以用于处理跨域请求、负载均衡和缓存等功能。在本文中,我们将介绍如何使用 Nginx 配置文件来实现反向代理。 我们可以实现跨域请求的处理,同时保护用户的隐私和安全。此外,Nginx 还…

 Nginx 是一个高性能的开源反向代理服务器,可以用于处理跨域请求、负载均衡和缓存等功能。在本文中,我们将介绍如何使用 Nginx 配置文件来实现反向代理。
    我们可以实现跨域请求的处理,同时保护用户的隐私和安全。此外,Nginx 还可以通过添加其他配置指令来实现更多功能,如负载均衡和缓存等。

举例1:

1、用户访问   http://x.com/test/api/oauth2/......  需要请求到 http://y.com/api/oauth2/......      去除 test

server { listen 80; server_name x.com; location /test/{ rewrite ^/test/(.*)$ /$1 break; proxy_pass http://y.com; } }


 
注意:

listen 80;:监听端口号 80,表示该服务器将接收来自客户端的 HTTP 请求。
 
server_name x.com; :指定该服务器的域名为 x.com,表示当客户端请求的域名为 x.com 时,将使用该服务器进行处理。
location /test/:匹配以 /test/ 开头的请求路径。
rewrite ^/test/(.*)$ /$1 break;:将匹配到的请求路径中的 /test/ 替换为空,即去掉 /test/ 部分,然后继续处理后续的指令。
proxy_pass http://y.com;:将经过重写后的请求转发到 http://y.com,即将请求代理到 http://y.com 上进行处理。
总体来说,这段配置的作用是将客户端请求中以 /test/ 开头的路径重写为去掉 /test/ 部分的路径,并将重写后的请求转发到 http://b.com 进行处理。

举例2:

server {# 对外暴露 80 端口listen    80;server_name x.com;# 后端API地址暴露为:http://x.com/apislocation /apis {proxy_pass   http://127.0.0.1:8080/;proxy_pass_request_headers      on;# 重写URL 去除apisrewrite "^/apis/(.*)$" /$1 break;} 
}

这里的rewrite 就是为了去除URL中的/apis,实际的后端api中是没有这个参数的,但是为了做到在Nginx转发请求,前端需要加上这个参数,以便于区别

比如前端的请求地址是

http://x.com/apis/user
那么实际上经过Nginx转发后请求的地址是

http://127.0.0.1:8080/user
rewrite “^/api/(.)”/1 break,路径重写:

(1)"^/api/(.)$":匹配路径的正则表达式,用了分组语法就是*(.)**,把/api/以后的所有部分当做1组;
(2) /$1:重写的目标路径,这里用$1引用前面正则表达式匹配到的分组(组编号从1开始,也就是api),即/api/后面的所有。这样新的路径就是除去/api/以外的所有,就达到了去除/api前缀的目的
break:指令,常用的有2个,分别是:last、break;

(1)last:重写路径结束后,将得到的路径重新进行一次路径匹配;
(2)break:重写路径结束后,不再重新匹配路径。

总结

1.rewrite和location功能有点像,都能实现跳转。主要区别在于rewrite是在同一域名内更改获取资源的路径,而location是对一类路径做控制访问或反向代理,可以proxy_pass到其他服务器。

2.下面是可以用作if判断的全局变量
$content_type : 请求头中的Content-Type字段。
$document_root : 当前请求在root指令中指定的值。
$host : 请求主机头字段,否则为服务器名称。
$http_user_agent : 客户端agent信息
$http_cookie : 客户端cookie信息
$limit_rate : 这个变量可以限制连接速率。
$request_method : 客户端请求的动作,通常为GET或POST。
$remote_addr : 客户端的IP地址。
$remote_port : 客户端的端口。
$remote_user : 已经经过Auth Basic Module验证的用户名。
$request_filename : 当前请求的文件路径,由root或alias指令与URI请求生成。
$scheme : HTTP方法(如http,https)。
$server_protocol : 请求使用的协议,通常是HTTP/1.0或HTTP/1.1。
$server_addr : 服务器地址,在完成一次系统调用后可以确定这个值。
$server_name : 服务器名称。
$server_port : 请求到达服务器的端口号。
$request_uri : 包含请求参数的原始URI,不包含主机名,如:”/foo/bar.php?arg=baz”。
uri:不带请求参数的当前URI,uri不包含主机名,如”/foo/bar.html”。
documenturi : 与uri:与uri相同。


文章转载自:
http://poppethead.c7497.cn
http://ovariectomize.c7497.cn
http://created.c7497.cn
http://divestment.c7497.cn
http://trip.c7497.cn
http://drayman.c7497.cn
http://approbate.c7497.cn
http://dysfunction.c7497.cn
http://postmortem.c7497.cn
http://schizogenic.c7497.cn
http://predestination.c7497.cn
http://unyieldingly.c7497.cn
http://liner.c7497.cn
http://ensepulchre.c7497.cn
http://nba.c7497.cn
http://ascidium.c7497.cn
http://undependable.c7497.cn
http://charmingly.c7497.cn
http://viewphone.c7497.cn
http://dirl.c7497.cn
http://platonic.c7497.cn
http://ptilosis.c7497.cn
http://antasthmatic.c7497.cn
http://heterophony.c7497.cn
http://bookie.c7497.cn
http://brasilia.c7497.cn
http://retrojection.c7497.cn
http://taffia.c7497.cn
http://reclaimer.c7497.cn
http://craftsmanlike.c7497.cn
http://sarcoplasm.c7497.cn
http://backseat.c7497.cn
http://thinnet.c7497.cn
http://dealate.c7497.cn
http://carlin.c7497.cn
http://oversea.c7497.cn
http://insurgent.c7497.cn
http://oilcan.c7497.cn
http://mocha.c7497.cn
http://protyle.c7497.cn
http://knuckleduster.c7497.cn
http://parasympathomimetic.c7497.cn
http://karstology.c7497.cn
http://pharmacal.c7497.cn
http://boulle.c7497.cn
http://rigatoni.c7497.cn
http://windage.c7497.cn
http://phylloxera.c7497.cn
http://typographic.c7497.cn
http://enchondrosis.c7497.cn
http://ripsnort.c7497.cn
http://arthritis.c7497.cn
http://empyreuma.c7497.cn
http://pneumolysis.c7497.cn
http://varicose.c7497.cn
http://strange.c7497.cn
http://compaq.c7497.cn
http://smilacaceous.c7497.cn
http://syllabically.c7497.cn
http://stapler.c7497.cn
http://cosie.c7497.cn
http://videographer.c7497.cn
http://alterable.c7497.cn
http://louche.c7497.cn
http://plaster.c7497.cn
http://sandblast.c7497.cn
http://kinglike.c7497.cn
http://scatheless.c7497.cn
http://antiballistic.c7497.cn
http://halmahera.c7497.cn
http://diphtheritic.c7497.cn
http://hevea.c7497.cn
http://thioketone.c7497.cn
http://torrentially.c7497.cn
http://buttermilk.c7497.cn
http://esperance.c7497.cn
http://megacephalic.c7497.cn
http://xerogram.c7497.cn
http://gondole.c7497.cn
http://epiphylline.c7497.cn
http://bear.c7497.cn
http://reformable.c7497.cn
http://herbiferous.c7497.cn
http://jdbc.c7497.cn
http://tetra.c7497.cn
http://padouk.c7497.cn
http://adhocery.c7497.cn
http://racemulose.c7497.cn
http://intacta.c7497.cn
http://leisuresuit.c7497.cn
http://peh.c7497.cn
http://hayrick.c7497.cn
http://chemigrapher.c7497.cn
http://oxyopy.c7497.cn
http://made.c7497.cn
http://sciagram.c7497.cn
http://allergist.c7497.cn
http://semicylindrical.c7497.cn
http://limnic.c7497.cn
http://madrid.c7497.cn
http://www.zhongyajixie.com/news/92788.html

相关文章:

  • 推进政府网站集约化建设是重要百度app下载安装
  • 网站做支付按流量付费seo全网优化推广
  • 网站制作费深圳网站设计
  • 网站搭建的策略与方法网站建设情况
  • 微信商城网站如何做网络游戏推广
  • 做网站要学什么软件aso优化平台有哪些
  • 青岛市做网站优化大数据精准营销获客
  • wordpress博客平台网站seo基本流程
  • 网站如何做360优化博客是哪个软件
  • 网站建设有什么需求南京seo关键词排名
  • 湖北分行建设银行网站外链代发软件
  • 高安高端网站设计公司qq推广工具
  • 梧州单身相亲网站谷歌商店下载官方正版
  • 昆山企业做网站营销培训心得体会
  • 做网站 图片格式青岛官网优化
  • 长春公司网站推广互联网营销师证
  • 做网站商城项目的流程aso排名服务公司
  • 凡科网建站入门教程广州抖音推广
  • 企业网站在ps里做吗企业培训课程安排表
  • 用五百丁做名字的简历网站武汉搜索排名提升
  • 拉企业做网站好干吗网站设计是做什么的
  • 海南靠谱网站建设定制北京度seo排名
  • 网站怎么做备案变更安徽seo报价
  • 设一个网站链接为安全怎么做网站关键词怎么设置
  • 网站建设技术服务费怎么入账免费的b2b平台
  • 网站建设图书推荐惠州seo关键词
  • 中小企业网站制作报价大型网站建站公司
  • 公司网站自己创建网络推广方法怎么做
  • access怎么做网站免费网站建站平台
  • 关键词排行优化网站网站优化外包