2018年1月4日

nginx 访问日志和切割日志

摘要: nginx 访问日志 日志格式vim /usr/local/nginx/conf/nginx.conf //搜索log_format $remote_addr: 客户端IP(公网IP)$http_x_forwarded_for: 代理服务器IP$time_local: 服务器本地时间$host: 访 阅读全文

posted @ 2018-01-04 10:33 游荡的鱼 阅读(174) 评论(0) 推荐(0) 编辑

nginx 静态文件不记录日志和过期时间

摘要: 静态文件不记录日志和过期时间 /usr/local/nginx/conf/vhost/test01.conf 增加配置如下 location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ { expires 7d; #有效时间 access_log off; #关闭日志 } l 阅读全文

posted @ 2018-01-04 10:31 游荡的鱼 阅读(368) 评论(0) 推荐(0) 编辑

nginx 域名重定向

摘要: nginx 域名重定向 在conf/vhost/中添加 test02.conf 文件 server { listen 80; server_name www.test02.com test02.com test2.com; index index.html index.htm index.php; 阅读全文

posted @ 2018-01-04 01:51 游荡的鱼 阅读(230) 评论(0) 推荐(0) 编辑

nginx 默认虚拟主机

摘要: nginx 默认虚拟主机 vim /usr/local/nginx/conf/nginx.conf //增加include vhost/*.conf; //加在http中 mkdir /usr/local/nginx/conf/vhost cd !$; vim default.conf /usr/l 阅读全文

posted @ 2018-01-04 01:49 游荡的鱼 阅读(121) 评论(0) 推荐(0) 编辑

nginx 用户认证

摘要: nginx 用户认证 vim /usr/local/nginx/conf/vhost/test.com.conf server { listen 80; server_name test.com; index index.html index.htm index.php; root /data/ww 阅读全文

posted @ 2018-01-04 01:49 游荡的鱼 阅读(143) 评论(0) 推荐(0) 编辑

nginx 安装

摘要: nginx 安装 cd /usr/src/local wget http://nginx.org/download/nginx-1.12.2.tar.gz tar -zxvf nginx-1.12.2.tar.gz ./configure —prefix=/usr/local/nginx make 阅读全文

posted @ 2018-01-04 01:48 游荡的鱼 阅读(162) 评论(0) 推荐(0) 编辑

导航