location

03.Nginx常用基础模块

。_饼干妹妹 提交于 2019-11-29 22:01:57
1.Nginx目录索引 ngx_http_autoindex_module模块处理以斜杠字符('/')结尾的请求,并生成目录列表。 当ngx_http_index_module模块找不到索引文件时,通常会将请求传递给模块。 1.指令 #启用或禁用目录列表输出,on开启,off关闭。 Syntax: autoindex on | off; Default: autoindex off; Context: http, server, location #指定是否应在目录列表中输出确切的文件大小,on显示字节,off显示大概单位。 Syntax: autoindex_exact_size on | off; Default: autoindex_exact_size on; Context: http, server, location #指定目录列表中的时间是应以本地时区还是UTC输出。on本地时区,off UTC时间。 Syntax: autoindex_localtime on | off; Default: autoindex_localtime off; Context: http, server, location 2.示例配置 [root@web ~]# cat /etc/nginx/conf.d/module.conf server { listen 80; server

05.Nginx反向代理服务

本秂侑毒 提交于 2019-11-29 22:01:43
1.Nginx代理服务基本概述 1.代理一词往往并不陌生, 该服务我们常常用到如(代理理财、代理租房、代理收货等等),如下图所示 2.在没有代理模式的情况下,客户端和Nginx服务端,都是客户端直接请求服务端,服务端直接响应客户端。 3.那么在互联网请求里面, 客户端往往无法直接向服务端发起请求, 那么就需要用到代理服务, 来实现客户端和服务通信,如下图所示 2.Nginx代理服务常见模式 那Nginx作为代理服务, 按照应用场景模式进行总结,代理分为正向代理、反向代理 正向代理,(内部上网) 客户端<-->代理->服务端 反向代理,用于公司集群架构中,客户端->代理<-->服务端 5.正向与反向代理的区别 区别在于形式上服务的"对象"不一样 正向代理代理的对象是客户端,为客户端服务 反向代理代理的对象是服务端,为服务端服务 3.Nginx代理服务支持协议 1.Nginx作为代理服务,可支持的代理协议非常的多,具体如下图 2.如果将Nginx作为反向代理服务,常常会用到如下几种代理协议,如下图所示 3.反向代理模式与Nginx代理模块总结如表格所示 反向代理模式 Nginx配置模块 http、websocket、https ngx_http_proxy_module fastcgi ngx_http_fastcgi_module uwsgi ngx_http_uwsgi

第一次个人编程作业

五迷三道 提交于 2019-11-29 21:55:21
个人仓库 PSP2.1 Personal Software Process Stages 预估耗时(分钟) 实际耗时(分钟) Planning 计划 30 20 ·Estimate 估计这个任务需要多少时间 30 20 Development 开发 770 1445 ·Analysis 需求分析 (包括学习新技术) 100 240 ·Design Spec 生成设计文档 60 100 ·Design Review 设计复审 60 100 ·Coding Standard 代码规范 (为目前的开发制定合适的规范) 10 20 ·Design 具体设计 100 125 ·Coding 具体编码 240 360 ·Code Review 代码复审 100 200 ·Test 测试(自我测试,修改代码,提交修改) 100 300 Reporting 报告 35 60 ·Test Repor 测试报告 10 20 ·Size Measurement 计算工作量 5 15 ·Postmortem & Process Improvement Plan 事后总结, 并提出过程改进计划 20 25 合计 835 1525 计算模块接口的设计与实现过程: 函数名 作用 def creatsheng() 用于存储全国所有省份 def creatshi() 用于存储全国所有市级 def phone

Nginx配置详解

倾然丶 夕夏残阳落幕 提交于 2019-11-29 21:24:23
Nginx配置详解 序言 Nginx是lgor Sysoev为俄罗斯访问量第二的rambler.ru站点设计开发的。从2004年发布至今,凭借开源的力量,已经接近成熟与完善。 Nginx功能丰富,可作为HTTP服务器,也可作为反向代理服务器,邮件服务器。支持FastCGI、SSL、Virtual Host、URL Rewrite、Gzip等功能。并且支持很多第三方的模块扩展。 Nginx的稳定性、功能集、示例配置文件和低系统资源的消耗让他后来居上,在全球活跃的网站中有12.18%的使用比率,大约为2220万个网站。 牛逼吹的差不多啦,如果你还不过瘾,你可以百度百科或者一些书上找到这样的夸耀,比比皆是。 Nginx常用功能 1、Http代理,反向代理:作为web服务器最常用的功能之一,尤其是反向代理。 这里我给来2张图,对正向代理与反响代理做个诠释,具体细节,大家可以翻阅下资料。 Nginx在做反向代理时,提供性能稳定,并且能够提供配置灵活的转发功能。Nginx可以根据不同的正则匹配,采取不同的转发策略,比如图片文件结尾的走文件服务器,动态页面走web服务器,只要你正则写的没问题,又有相对应的服务器解决方案,你就可以随心所欲的玩。并且Nginx对返回结果进行错误页跳转,异常判断等。如果被分发的服务器存在异常,他可以将请求重新转发给另外一台服务器,然后自动去除异常服务器。 2、负载均衡

前端页面刷新与跳转

蹲街弑〆低调 提交于 2019-11-29 21:19:26
a标签里面的刷新方式 1、<a href="javascript:" onclick="history.go(-2); ">返回前两页</a> 2、<a href="javascript:" onclick="self.location=document.referrer;">返回上一页并刷新</a> 3、<a href="javascript:" onclick="history.back(); ">返回上一页</a> 4、<a href="javascript:history.go(-1)">返回上一页</a> 5、<a href="javascript:location.reload()">重载页面,本地刷新</a> 6、<a href="javascript:history.go(-1);location.reload()">返回上一页重载页面,本地刷新</a> 7、<a href="javascript:window.stop()">停止跳转</a>(停止跳转:IE浏览器用document.execCommand("Stop"),Chrome和Firefox用window.stop() ) 局部刷新 (“#table_table”是需要刷新的框架id):$("#refresh_box").load(location.href+" #refresh_content");

ios deferred location updates fail to defer

放肆的年华 提交于 2019-11-29 21:11:34
问题 I am looking into using deferred location updates for an iOS activity tracker, which allows location services in background. I've implemented the suggested code snippets (see below). In Xcode debugging, deferred locations attempt to start a few times until location data comes in at about 1 per second. After that, it claims to succeed in starting deferrals, and the callback for the finish trigger also succeeds after the specified time period expires. However during the time, the location

后端必备 Nginx 配置

我的梦境 提交于 2019-11-29 20:48:20
后端必备 Nginx 配置 概要 防盗链 根据文件类型设置过期时间 静态资源访问 日志配置 日志字段说明 access_log 访问日志 error_log 日志 日志切割 反向代理 禁止指定user_agent nginx访问控制 负载均衡 防盗链 location ~* \.(gif|jpg|png)$ { # 只允许 192.168.0.1 请求资源 valid_referers none blocked 192.168.0.1; if ($invalid_referer) { rewrite ^/ http://$host/logo.png; } } 根据文件类型设置过期时间 location ~.*\.css$ { expires 1d; break; } location ~.*\.js$ { expires 1d; break; } location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ { access_log off; expires 15d; #保存15天 break; } # curl -x127.0.0.1:80 http://www.test.com/static/image/common/logo.png -I #测试图片的max-age 静态资源访问 http { # 这个将为打开文件指定缓存,默认是没有启用的,max

JS 返回上一步(退回上一步上一个网页)

心已入冬 提交于 2019-11-29 20:34:58
链接式: <a href="javascript:history.go(-1)">返回上一步</a> <a href="<%=Request.ServerVariables("HTTP_REFERER")%>">返回上一步</a> 按钮式: <INPUT name="pclog" type="button" value="GO" onClick="location.href=’http://www.ekesn.com/‘"> 直接跳转式: <script>window.location.href=’http://www.ekesn.com‘;</script> JS跳转页面参考代码 第一种: <script language="javascript" type="text/javascript"> window.location.href="login.jsp?backurl="+window.location.href; </script> 第二种: <script language="javascript"> alert("返回"); window.history.back(-1); </script> 第三种: <script language="javascript"> window.navigate("top.jsp"); </script> 第四种: <script

Decoding the CLLocationAccuracy const's

爱⌒轻易说出口 提交于 2019-11-29 20:08:11
the following are listed in CLLocation.h but from my experience they are deceiving names- possibly originally thought up to serve two purposes, 1. to test the accuracy of the location returned, but also 2. to set how hard the location manager works, specifically what is enabled (gps (how many sat channels), how hard the wifi works, triangulation etc. extern const CLLocationAccuracy kCLLocationAccuracyBestForNavigation; // (raw value: -2) extern const CLLocationAccuracy kCLLocationAccuracyBest; // (raw value: -1) extern const CLLocationAccuracy kCLLocationAccuracyNearestTenMeters; // (raw value

Nginx 配置学习

◇◆丶佛笑我妖孽 提交于 2019-11-29 19:59:58
官方文档 一、概述 Nginx的配置放在配置文件nginx.conf /etc/nginx/nginx.conf 中,大概的结构如下: main # 全局配置 events { # nginx工作模式配置 } http { # http设置 .... server { # 服务器主机配置 .... location { # 路由配置 .... } location path { .... } location otherpath { .... } } server { .... location { .... } } upstream name { # 负载均衡配置 .... } } 主要有 main,全局配置 event nginx工作模式 http http服务器的配置 server 服务器访问的配置 location 路由配置 upstream 负载均衡配置 二、main模块 全局配置并不需要包含在大括号中。 user nginx; worker_processes 1; error_log /var/log/nginx/error.log warn; pid /var/run/nginx.pid; worker_rlimit_nofile 1024; nginx 用哪个用户来启动 worker_processes 启动的进程数,一般是CPU数量的两倍 error_log