Skip to content

Commit

Permalink
change nginx.conf,add group
Browse files Browse the repository at this point in the history
  • Loading branch information
893271511 committed Jan 28, 2016
1 parent 57ec554 commit abc1230
Showing 1 changed file with 68 additions and 72 deletions.
140 changes: 68 additions & 72 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@

#user nobody;
worker_processes 1;

error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;

#pid logs/nginx.pid;
error_log logs/error.log debug;
pid logs/nginx.pid;


events {
Expand All @@ -18,90 +14,90 @@ 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"';

#access_log logs/access.log main;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';

log_format json '{"time_ios8601":"$time_iso8601",'
'"remote_addr":"$remote_addr",'
'"http_x_forwarded_for":"$http_x_forwarded_for",'
'"scheme":"$scheme",'
'"server_name":"$server_name",'
'"server_port":"$server_port",'
'"request_method":"$request_method",'
'"uri":"$uri",'
'"args":"$args",'
'"server_protocol":"$server_protocol",'
'"status":"$status",'
'"bytes_sent":"$bytes_sent",'
'"http_referer":"$http_referer",'
'"request_time":"$request_time",'
'"upstream_response_time":"$upstream_response_time",'
'"upstream_addr":"$upstream_addr",'
'"body_bytes_sent":"$body_bytes_sent",'
'"content_length":"$content_length",'
'"http_cookie":"$http_cookie",'
'"hostname":"$hostname",'
'"host_user_agent":"$http_user_agent"}';

access_log logs/access.log json;

sendfile on;
#tcp_nopush on;

#keepalive_timeout 0;
keepalive_timeout 65;

#gzip on;
#
lua_package_path "/usr/local/openresty/nginx/conf/lua/?.lua;;";


# another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias;

# location / {
# root html;
# index index.html index.htm;
# }
#}


# HTTPS server
#
#server {
# listen 443 ssl;
# server_name localhost;

# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;

# ssl_session_cache shared:SSL:1m;
# ssl_session_timeout 5m;

# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on;

# location / {
# root html;
# index index.html index.htm;
# }
#}

lua_package_path "/usr/local/nginx-1.8.0/conf/lua/?.lua;;";

server {
listen 80;
location / {
default_type text/html;
content_by_lua '
ngx.say("<p>hello, world</p>")
';
}
listen 777;
server_name localhost;
#lua_code_cache off;

location /hello {
default_type text/html;
echo "hello, world";
location / {
root html;
index index.html index.htm;
}

location /group1/M00 {
alias /data/images;
location /group1/M00 {
#root /data1/fdfs_tracker/data/;
alias /data1/images;
set $image_root "/data1/images";
if ($uri ~ "/([a-zA-Z0-9]+)/([a-zA-Z0-9]+)/([a-zA-Z0-9]+)/([a-zA-Z0-9]+)/(.*)") {
set $image_dir "$image_root/$3/$4/";
set $image_name "$5";
set $file "$image_dir$image_name";
}

#set $image_root "/usr/local/openresty/nginx/proxy_tmp/images";
set $image_root "/data/images";
if (!-f $file) {
content_by_lua_file "conf/lua/fastdfs.lua";
}
}
location /group2/M00 {
#root /data1/fdfs_tracker/data/;
alias /data1/images;
set $image_root "/data1/images";
if ($uri ~ "/([a-zA-Z0-9]+)/([a-zA-Z0-9]+)/([a-zA-Z0-9]+)/([a-zA-Z0-9]+)/(.*)") {
set $image_dir "$image_root/$3/$4/";
set $image_name "$5";
set $file "$image_dir$image_name";
}

if (!-f $file) {
# 关闭lua代码缓存,方便调试lua脚本
#lua_code_cache off;
content_by_lua_file "conf/lua/fastdfs.lua";
}
}
location /group3/M00 {
#root /data1/fdfs_tracker/data/;
alias /data1/images;
set $image_root "/data1/images";
if ($uri ~ "/([a-zA-Z0-9]+)/([a-zA-Z0-9]+)/([a-zA-Z0-9]+)/([a-zA-Z0-9]+)/(.*)") {
set $image_dir "$image_root/$3/$4/";
set $image_name "$5";
set $file "$image_dir$image_name";
}

if (!-f $file) {
content_by_lua_file "conf/lua/fastdfs.lua";
}
#ngx_fastdfs_module;
}
}
}
}

0 comments on commit abc1230

Please sign in to comment.