nginx

标签: nginx

nginx日志过滤

nginx单条日志格式 61.135.169.92 - - [12/Mar/2018:17:24:45 +0800] "GET /changyan/version-v4.js?15208466853470.1961183244800202 HTTP/1.1" 200 2089 "http://www.apkfuns.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.

阅读全文...

nginx设置$_SERVER变量

CodeIgniter 设置开发和线上环境是通过设置$_SERVER['CI_ENV']来实现的。官方只介绍了apache的设置方式,nginx下怎么配置呢? 通过在php-fpm.conf文件添加如下代码 [www] listen = /tmp/php-cgi.sock listen.backlog = -1 listen.allowed_clients = 127.0.0.1 listen.owner = www listen.group = www listen.mode = 0666 ... # 添加这句!!! env[CI_ENV] = production php-fpm.conf默认位置在/usr/local/php/etc/php-fpm.conf, 不在的话可以通过命令查找 find / -name

阅读全文...

nginx设置子域名都跳转到www域名下

方法1: 域名解析时设置泛解析 方法2:nginx配置: server { listen 80; server_name apkfuns.com *.apkfuns.com www.apkfuns.com; if ($host != "www.apkfuns.com") { rewrite ^/(.*)$ http://www.apkfuns.com/$1 permanent; } } 设置完别忘了重启服务器 service nginxd restart

阅读全文...