#user nobody; worker_processes 1; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; error_log logs/error.log debug; pid logs/nginx.pid; events { worker_connections 1024; } stream { server { listen 192.168.20.254:21; proxy_pass ftp_cluster; proxy_buffer_size 16k; } upstream ftp_cluster{ zone ftp_cluster 64k; server 120.92.141.156:21; } } 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" "$request_body"'; lua_need_request_body on; access_log logs/access.log main; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; #gzip on; # proxy_temp_path /usr/local/openresty/nginx/proxy_temp_dir 1 2; # keys_zone=cache1:100m indicates that the zone name is cache1, and the allocated memory size is 100MB # /usr/local/nginx/proxy_cache_dir/cache1 Indicates the directory where the files in the zone of cache1 are to be stored # levels=1:2 means that the first-level directory of the cache directory is 1 character, and the second-level directory is 2 characters, that is, /usr/local/nginx/proxy_cache_dir/cache1/a/1b This form # inactive=1d means that if the cache file in this zone is not accessed within 1 day, the file will be deleted by the cache manager process # max_size=10g means that the hard disk capacity of this zone is 10GB # # proxy_cache_path /usr/local/openresty/nginx/proxy_cache_dir/cache1 levels=1:2 keys_zone=cache1:100m inactive=1d max_size=10g; server { listen 10086; server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location ^~ /ody/swift/agent { set $agentip ''; access_by_lua ' ngx.log(ngx.NOTICE, "--- 1 ---") ngx.req.read_body() local args = ngx.req.get_post_args() for key, val in pairs(args) do if type(val) == "table" then ngx.log(ngx.NOTICE, "--- 2 ---") ngx.log(ngx.NOTICE,key, ": ", table.concat(val, ", ")) else ngx.log(ngx.NOTICE, "--- 3 ---") ngx.log (ngx.NOTICE, key) ngx.log (ngx.NOTICE, val) local cjson = require("cjson") local j = cjson.decode(key) ngx.log (ngx.NOTICE, j.ip) ngx.var.agentip = j.ip end ngx.log(ngx.NOTICE, "--- 4 ---") end '; proxy_pass http://$agentip:33433; proxy_connect_timeout 600s; proxy_send_timeout 600s; proxy_read_timeout 600s; } location ^~ /ody/swift/collo { proxy_pass http://172.16.2.44:8080; proxy_connect_timeout 600s; proxy_send_timeout 600s; proxy_read_timeout 600s; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } # proxy the PHP scripts to Apache listening on 127.0.0.1:80 # #location ~ \.php$ { # proxy_pass http://127.0.0.1; #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # #location ~ \.php$ { # root html; # fastcgi_pass 127.0.0.1:9000; # fastcgi_index index.php; # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; # include fastcgi_params; #} # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /\.ht { # deny all; #} } # 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; # } #} }