[ggp@test182 ~]$ ll .ssh total 8 -rw-r--r-- 1 ggp ggp 588 Sep 25 17:19 authorized_keys [ggp@test182 ~]$ ll .ssh/authorized_keys -rw-r--r-- 1 ggp ggp 588 Sep 25 17:19 .ssh/authorized_keys [ggp@test182 ~]$ 切记将.ssh的权限改为700,authorized...
远程一台法国的服务器结果一直连接不上,ping测试丢包严重,手上正好有一台日本的服务器,本地ping测试不丢包,延迟小于70,脑中突然冒出一个想法,为何不用日本的服务器中继一下法国的服务器,需要做的就是映射。 1、开启内核的数据转发 首先修改/etc/sysctl...
Nginx的配置就好像做程序一样,其实很好玩。 笔记一下: server { listen 80; server_namewww.aslibra.com; set $aslibra_auth ; if ( $http_cookie ~* aslibra_auth=(.+)(?:;|$) ){ set $aslibra_auth $1; } log_format main$proxy_add_x_forwarded_for - $...
事例一: server { listen 80; server_namewww.it.net.cn; set $aslibra_auth ; if ( $http_cookie ~* aslibra_auth=(.+)(?:;|$) ){ set $aslibra_auth $1; } log_format main$proxy_add_x_forwarded_for - $remote_user [$time_local] $request $status $by...
需求,把cookie记录到访问日志里,供数据挖掘部门统计用户行为。 nginx 配置文件添加如下,这是虚拟主机的配置 server { # 在server块添加以下代码 # 设置默认值 set $uid - ; # 存在值则赋值 if ( $http_cookie ~* at_uvid=(\S+)(;.*|$) ){ set $uid $1 ; }...
如果你对nginx日志格式,有这样那样的要求。 那么就看一下说明吧。 $remote_addr The remote host$remote_user The authenticated user ( if any)$time_local The time of the access$request The first line of the request$status The status of the reque...
#!/bin/bash #日志文件存放目录 logs_path=/data/Service/nginx/logs #日志文件的名字,多个需要空格隔开 logs_names=(dm_access) mkdir-p${logs_path}/$(date-dyesterday+%Y)/$(date-dyesterday+%m)/ num=${#logs_names[@]} for((i=0;inum;i++)) do #chown...
Nginx的反向代理通常用来映射内网中提供的Apache、IIS、Lighttpd服务,以实现负载均衡;同时,由于动态服务程序运行在内网,服务器的整体安全性也有所提高,那么怎样用nginx设置SSL的反向代理呢? 使用nginx设置SSL的优点不少: 易用性:nginx安装、升级简单...
登录认证account.free4lab.com需要提供ssl登录接口,ssl的原理看这篇博文,因为前面有反向代理nginx,所以这个需求就放在nginx实现了,否则可以放在web容器(jetty,tomcat)上实现,如何在容器实现ssl部署可以看之前的一篇博文linux tomcat配置https 步骤: 1....
server { listen 80; server_name coddict.tk; rewrite ^(.*)$ https://$host$1 permanent; } server { listen 443; server_name coddict.tk; ssl on; ssl_certificate /etc/nginx/ssl/nginx.crt; ssl_certificate_key /etc/nginx/ssl/nginx.key; location /...