hellopasswd
10年的宝塔网站建设经验,针对设计、前端、开发、售后、文案、推广等六对一服务,响应快,48小时及时工作处理。全网营销推广的优势是能够根据用户设备显示端的尺寸不同,自动调整宝塔建站的显示方式,使网站能够适用不同显示终端,在浏览器中调整网站的宽度,无论在任何一种浏览器上浏览网站,都能展现优雅布局与设计,从而大程度地提升浏览体验。创新互联从事“宝塔网站设计”,“宝塔网站推广”以来,每个客户项目都认真落实执行。[root@localhost vhost]# vi ../nginx.conf /fog_format
log_format combined_realip \'$remote_addr $http_x_forwarded_for [$time_local]\' \' $host "$request_uri" $status\' \' "$http_referer" "$http_user_agent"\'; 其中combined_realip 日志名 $remote addr 客户端IP(公网IP) $http_x_forwarded_for 代理服务器的IP $time_local 服务器本地时间 $host f访问主机名(域名) $request_uri 访问的url地址 $status 状态码 $http_referer referer $http_user_agent user_agent
添加access_log /tmp/test.com.log user;
[root@localhost vhost]# vi test.com.conf 1 server 2 { 3 listen 80; 4 server_name test.com test1.com test2.com; 5 index index.html index.htm index.php; 6 root /data/wwwroot/test.com; 7 if ($host != \'test.com\'){ 8 rewrite ^/(.*)$ http://test.com/$1 permanent; 9 } 10 11 location ~(.*)admin.php$ 12 { 13 auth_basic "Auth"; 14 auth_basic_user_file /usr/local/nginx/conf/htpasswd; 15 } 16 access_log /tmp/test.com.log user; 17 } [root@localhost vhost]# /usr/local/nginx/sbin/nginx -t nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful [root@localhost vhost]# /usr/local/nginx/sbin/nginx -s reload
[root@localhost vhost]# curl -x 127.0.0.1:80 test2.com/admin/index.html -I HTTP/1.1 301 Moved Permanently Server: nginx/1.4.7 Date: Thu, 04 Jan 2018 08:07:12 GMT Content-Type: text/html Content-Length: 184 Connection: keep-alive Location: http://test.com/admin/index.html [root@localhost vhost]# curl -x 127.0.0.1:80 test1.com/admin/index.html -I HTTP/1.1 301 Moved Permanently Server: nginx/1.4.7 Date: Thu, 04 Jan 2018 08:07:16 GMT Content-Type: text/html Content-Length: 184 Connection: keep-alive Location: http://test.com/admin/index.html [root@localhost vhost]# cat /tmp/test.com.log 127.0.0.1 - - [04/Jan/2018:16:07:12 +0800] "HEAD HTTP://test2.com/admin/index.html HTTP/1.1" 301 0 "-" "curl/7.29.0" 127.0.0.1 - - [04/Jan/2018:16:07:16 +0800] "HEAD HTTP://test1.com/admin/index.html HTTP/1.1" 301 0 "-" "curl/7.29.0"
当前名称:【CentOS7LNMP架构24】,nginx访问日志#180105
标题URL:https://www.cdcxhl.com/article26/cpeejg.html
成都网站建设公司_创新互联,为您提供移动网站建设、建站公司、营销型网站建设、虚拟主机、域名注册、微信小程序
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联