location

【NGINX】LINUX安装NGINX

本小妞迷上赌 提交于 2020-01-21 08:35:58
安装依赖 () · yum install gcc · yum install pcre-devel · yum install zlib zlib-devel · yum install openssl openssl-devel · //一键安装上面四个依赖 · yum -y install gcc zlib zlib-devel pcre-devel openssl openssl-devel 下载 nginx 的 tar 包 · //创建一个文件夹 · cd /usr/local · mkdir nginx · cd nginx · //下载tar包 . wget http://nginx.org/download/nginx-1.13.7.tar.gz .//解压tar包 tar -zxvf nginx-1.13.7.tar.gz 安装 nginx( 如果 configure 报 xx not found 就在后面加 with-xx=路径 ) · //进入nginx目录 · cd /usr/local/nginx · //执行配置命令 注意:--with-http_ssl_module 开启SSL模块,支持Https请求 · ./configure --prefix=/usr/local/nginx --sbin-path=/usr/local/nginx/sbin

JS相关应用

好久不见. 提交于 2020-01-21 07:18:36
文章目录 1、js 跳转链接的几种方式 1.1 跳转链接在当前窗口打开 1.2 跳转链接 在新窗口打开 1.3 跳转链接 返回上一页 1.4、跳转链接 2、SpringMVC接收前台Ajax传送json数据 1、js 跳转链接的几种方式 1.1 跳转链接在当前窗口打开 window . location . href = "http://www.baidu.com" 等价于 < a href = "baidu.com" target = "_self" > go baidu < / a > 1.2 跳转链接 在新窗口打开 window . open ( "http://www.baidu.com" ) 等价于 < a href = "baidu.com" target = "_blank" > go baidu < / a > 1.3 跳转链接 返回上一页 window . history . back ( - 1 ) ; 1.4、跳转链接 self . location . href = "baidu.com" self 指代当前窗口对象,属于window 最上层的对象。 location.href 指的是某window对象的url的地址 self.location.href 指当前窗口的url地址,去掉self默认为当前窗口的url地址,一般用于防止外部的引用  top

Sample code for finding location using IP address in java? [duplicate]

末鹿安然 提交于 2020-01-21 05:25:07
问题 This question already has answers here : Need a client side API for determing geo location of IP addresses (3 answers) Closed 6 years ago . I am looking for the sample code to get Exact Location of IP. I did goggling but haven't find any Sample code. Thank You.. 回答1: I've used the MaxMind GeoIP Lite database to good success before. Both city and country databases and APIs are available. An example of usage is: File dbfile = new File("db/GeoLiteCity.dat"); LookupService lookupService = new

Nginx安装及配置

与世无争的帅哥 提交于 2020-01-21 01:20:42
Nginx (engine x) 是一个高性能的HTTP和反向代理web服务器,同时也提供了IMAP/POP3/SMTP服务。Nginx是由伊戈尔·赛索耶夫为俄罗斯访问量第二的Rambler.ru站点(俄文:Рамблер)开发的,第一个公开版本0.1.0发布于2004年10月4日。 其将源代码以类BSD许可证的形式发布,因它的稳定性、丰富的功能集、示例配置文件和低系统资源的消耗而闻名。2011年6月1日,nginx 1.0.4发布。 Nginx是一款轻量级的Web 服务器/反向代理服务器及电子邮件(IMAP/POP3)代理服务器,在BSD-like 协议下发行。其特点是占有内存少,并发能力强,事实上nginx的并发能力在同类型的网页服务器中表现较好,中国大陆使用nginx网站用户有:百度、京东、新浪、网易、腾讯、淘宝等。 一、nginx可以实现的功能 1、可以作为静态资源的web服务器、可以缓存文件的资源描述符——加速 2、支持对http、stmp、pop3等多种协议的反向代理 3、支持实现缓存和负载均衡 4、支持fcgi 5、支持uWSCGI 6、支持模块化 7、支持过滤器,对特定文件进行压缩传输 8、支持ssl 9、支持图像大小调整 二.、nginx的特性 1、模块 2、高性能 3、低内存消耗 4、支持热部署 5、支持异步IO 6、支持事件驱动 7、支持内存映射 三、核心模块

Nginx的配置文件各个模块介绍

五迷三道 提交于 2020-01-20 08:10:30
一、前言 学习Nginx首先需要对它的核心配置文件nginx.conf有一定的认识,Nginx的核心配置文件主要由三个部分构成: 基本配置 events配置 http配置 二、各个模块的作用 #==============基本配置=================== #user nobody; #配置worker进程运行用户 worker_processes 1; #配置工作进程数目,根据硬件调整,通常等于CPU数量或2倍于CPU数量 #error_log logs/error.log; #配置全局错误日志以及类型 【debug | info | notice | warn | error | crit】,默认是error #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid; #配置进程pid文件 #==============events配置=================== #配置工作模式和连接数 events { #配置每个worker进程的连接数上限,nginx支持的总连接数就等于worker_processes*worker_connections worker_connections 1024; } #==============http配置==

解决location.href=“xxxx”无法跳转的问题

不问归期 提交于 2020-01-20 04:29:41
首先总结 location.href=“xxxx” 的多种用法如下: self.location.href="/url" 当前页面打开URL页面 location.href="/url" 当前页面打开URL页面 windows.location.href="/url" 当前页面打开URL页面,前面三个用法相同。 this.location.href="/url" 当前页面打开URL页面 parent.location.href="/url" 在父页面打开新页面 top.location.href="/url" 在顶层页面打开新页面 有些时候可能会遇到无法跳转的问题,这需要正确使用上面的跳转用法。 比如在前台有人会用target和iframe来实现提交表单数据但不跳转 <form action="" method="post" target="form_iframe"> <input type="text" id="" name="text" /> <input type="submit" id="" name="" value="提交" /> </form> <iframe id="form_iframe" name="form_iframe" style="display:none;"></iframe> 此时如果在后台使用windows.location.href="/url

nginx proxy_pass

烂漫一生 提交于 2020-01-19 18:49:42
原文链接: https://www.jianshu.com/p/b010c9302cd0 在nginx中配置proxy_pass代理转发时,如果在proxy_pass后面的url加/,表示绝对根路径;如果没有/,表示相对路径,把匹配的路径部分也给代理走。 假设下面四种情况分别用 http://192.168.1.1/proxy/test.html 进行访问。 第一种: location /proxy/ { proxy_pass http://127.0.0.1/; } 代理到URL: http://127.0.0.1/test.html 第二种(相对于第一种,最后少一个 / ) location /proxy/ { proxy_pass http://127.0.0.1; } 代理到URL: http://127.0.0.1/proxy/test.html 第三种: location /proxy/ { proxy_pass http://127.0.0.1/aaa/ ; } 代理到URL: http://127.0.0.1/aaa/test.html 第四种(相对于第三种,最后少一个 / ) location /proxy/ { proxy_pass http://127.0.0.1/aaa ; } 代理到URL: http://127.0.0.1/aaatest.html

Nginx——proxy_pass url 反向代理

北慕城南 提交于 2020-01-19 16:47:39
说到 Nginx 就不得不说 Nginx 的反向代理是多么的好用,一个指令 proxy_pass 搞定反向代理,对于接口代理、负载均衡很是实用,但 proxy_pass 指令后面的参数很有讲究。 在实际的应用中分为以下几种情况: 1.url 只是 host 这里指不包含 $uri ,如: http://host - √ https://host - √ http://host:port - √ https://host:port - √ http://host/ - x http://host:port/ - x 这时候 location 匹配的完整路径将直接透传给 url ,如: // 访问: / 后端: / // 访问: /api/xx 后端: /api/xx // 访问: /api/xx?aa 后端: /api/xx?aa location / { proxy_pass http://node:8080; } // 访问: /api/ 后端: /api/ // 访问: /api/xx 后端: /api/xx // 访问: /api/xx?aa 后端: /api/xx?aa // 访问: /api-xx?aa 后端: location /api/ { proxy_pass http://node:8080; } // 访问: /api/ 后端: /api/ // 访问:

nginx开发_配置项

怎甘沉沦 提交于 2020-01-19 04:42:30
nginx开发笔记_配置项 模块的配置项即nginx.conf中的指令,HTTP模块指令可以分为三个级别: main级,直接写在http{}块中的指令 server级,写在server{}块中的指令 location级,写在location{}块中的指令 配置项定义模板 在自定义模块中使用配置项,需要配置ngx_module_t的commands属性以及ctx属性,并需要定义一个结构体用于存放配置信息。 常用的模板如下: /* 存放配置信息的自定义结构体 */ typedef struct { ngx_flag_t my_flag; } ngx_http_mytest_conf_t; /* 模块声明 */ ngx_module_t ngx_http_mytest_module = { NGX_MODULE_V1, &ngx_http_mytest_module_ctx, /* module context */ ngx_http_mytest_commands, /* module directives */ NGX_HTTP_MODULE, /* module type */ NULL, /* init master */ NULL, /* init module */ NULL, /* init process */ NULL, /* init thread */ NULL,

Permission issues for location in android Marshmallow applicaton

南楼画角 提交于 2020-01-19 01:48:46
问题 I am learning to develop an android application for getting device location following Google developers forum: @http://developer.android.com/training/location/retrieve-current.html#last-known @http://developer.android.com/training/location/receive-location-updates.html The example shows how to use Google PLay Services for this purpose. But the getLastLocation() function always return null. Location location = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient); As initially