[root@nginx1 nginx]
worker_processes 2;
error_log
/var/log/nginx/nginx
.error.log;
pid
/var/run/nginx
.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application
/octet-stream
;
log_format main
'$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"'
;
sendfile on;
keepalive_timeout 65;
fastcgi_cache_path
/www/cache
levels=1:2 keys_zone=fcgicache:10m inactive=5m;
upstream mogfs_cluster {
server 192.168.0.45:7001;
server 192.168.0.46:7001;
}
server {
listen 4040;
server_name xxrenzhe.lnmmp.com;
access_log
/var/log/nginx/nginx-img
.access.log main;
root
/www/lnmmp
.com;
valid_referers none blocked xxrenzhe.lnmmp.com *.lnmmp.com;
if
($invalid_referer) {
rewrite ^/ http:
//xxrenzhe
.lnmmp.com
/404
.html
}
location ~* ^(
/images/
.*)$ {
mogilefs_tracker mogfs_cluster;
mogilefs_domain images;
mogilefs_noverify on;
mogilefs_pass $1 {
proxy_pass $mogilefs_path;
proxy_hide_header Content=Type;
proxy_buffering off;
}
}
}
server {
listen 80;
server_name xxrenzhe.lnmmp.com;
access_log
/var/log/nginx/nginx-static
.access.log main;
location / {
root
/www/lnmmp
.com;
index index.php index.html index.htm;
}
location ~* ^(
/text/
.*)$ {
mogilefs_tracker mogfs_cluster;
mogilefs_domain text;
mogilefs_noverify on;
mogilefs_pass $1 {
proxy_pass $mogilefs_path;
proxy_hide_header Content=Type;
proxy_buffering off;
}
}
gzip
on;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text
/plain
text
/css
application
/x-javascript
text
/xml
application
/xml
;
gzip_disable msie6;
}
server {
listen 8080;
server_name xxrenzhe.lnmmp.com;
access_log
/var/log/nginx/nginx-php
.access.log main;
location / {
root
/www/lnmmp
.com;
index index.php index.html index.htm;
}
error_page 404
/404
.html;
error_page 500 502 503 504
/50x
.html;
location =
/50x
.html {
root
/www/lnmmp
.com;
}
location ~ \.php$ {
root
/www/lnmmp
.com;
fastcgi_pass 127.0.0.1:9000;
fastcgi_cache fcgicache;
fastcgi_cache_valid 200 302 1h;
fastcgi_cache_valid 301 1d;
fastcgi_cache_valid any 1m;
fastcgi_cache_min_uses 1;
fastcgi_cache_key $request_method:
//
$host$request_uri;
fastcgi_cache_use_stale error timeout invalid_header http_500;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
}