nginx获取自定义header参数
2015-08-11 15:56
495 查看
修改配置文件fastcgi.conf,加上以下内容
修改nginx.conf,日志输出格式,添加$http_username
重启nginx
输出结果
fastcgi_param HTTP_USERNAME $http_username;
修改nginx.conf,日志输出格式,添加$http_username
log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for" "$http_username"';
重启nginx
输出结果
127.0.0.1 - - [11/Aug/2015:15:50:22 +0800] "GET /signin?ru=http://m.focus.cn/user/ HTTP/1.1" 200 4777 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.65 Safari/537.36" "-" "maso88"
fastcgi
fastcgi是快速通用网关接口的缩写,nginx的进程将请求通过unix domain socket(都位于同一物理服务器)或者一个IP Socket(FastCGI部署在其它物理服务器)传递给FastCGI进程,fastcgi处理完后返回给nginx进程相关文章推荐
- Ubutun 14.0.1+php5+Mysql+Nginx配置:
- nginx状态监控
- 最简单的Nginx+PHP
- 为PHP设置服务器(Apache/Nginx)环境变量
- Linux 查找nginx access_log 并删除一个月之前的log
- 如何用uWSGI和nginx搭建Django工程
- Nginx Rewrite 规则入门 伪静态规则
- 安装部署nginx
- Nginx启动错误:error while loading shared libraries: libpcre.so.1
- 使用nginx sticky实现基于cookie的负载均衡
- nginx 访问日志分析工具 goacess
- nginx 允许访问目录
- ngnix配置及实战
- nginx封ip,禁用IP段的设置说明
- nginx 直接在配置文章中设置日志分割
- nginx虚拟目录配置(php-fpm+fastcgi)
- nginx配置文件详解
- LNMP的Nginx启动脚本和配置文件
- linux centos6.5安装tengine(nginx)
- LNMP—Nginx的编译安装