背景:
阅读新闻
Ubuntu 10.04配置 nginx + php-fpm 模式
[日期:2013-01-10] 来源:Linux社区 作者:zinss [字体:]
nginx虚拟主机配置文件
upstream haolianxi_php {
server 127.0.0.1:9444;
}
server {
listen 192.168.1.137:7777;
access_log /var/log/nginx/haolianxi/haolianxi.access.log main;
error_log /var/log/nginx/haolianxi/haolianxi.error.log;
#通用匹配
location / {
root /srv/www/php/;
autoindex on;
autoindex_exact_size off;
autoindex_localtime on;
access_log /var/log/nginx/haolianxi/location.default.access.log main;
error_log /var/log/nginx/haolianxi/location.default.error.log;
allow 192.168.1.0/24;
deny all;
}
#正则表达式匹配
#proxy the php scripts to php-fpm
location ~ \.php$ {
root /srv/www/php/;
include /etc/nginx/fastcgi_params;
fastcgi_pass haolianxi_php; # The upstream determined above
fastcgi_index index.php;
}
#php-fpm status monitor
location = /phpfpm_status {
fastcgi_pass 127.0.0.1:9444;
fastcgi_index index.php;
include /etc/nginx/fastcgi_params;
allow 192.168.1.127;
allow 127.0.0.1;
deny all;
}
## Compression
# src:
# src: :nginx
gzip on;
gzip_http_version 1.0;
gzip_comp_level 2;
gzip_proxied any;
gzip_min_length 1100;
gzip_buffers 16 8k;
gzip_types text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;
# Some version of IE 6 don't handle compression well on some mime-types, so just disable for them
gzip_disable "MSIE [1-6].(?!.*SV1)";
# Set a vary header so downstream proxies don't send cached gzipped content to IE6
gzip_vary on;
## /Compression
}
注意:
include /etc/nginx/fastcgi_params中一个参数设置需要修改,修改如下:
fastcgi_param SCRIPT_NAME $document_root$fastcgi_script_name;
相关资讯
本文评论 查看全部评论 (0)
尊重网上道德,遵守中华人民共和国的各项有关法律法规 承担一切因您的行为而直接或间接导致的民事或刑事法律责任 本站管理人员有权保留或删除其管辖留言中的任意内容 本站有权在网站内转载或引用您的评论 参与本评论即表明您已经阅读并接受上述条款
评论声明
最新资讯