#Nginx global configuration (sample) user nginx; worker_processes 10; worker_rlimit_nofile 8192; events { worker_connections 1024; } #error_log /var/log/nginx.error_log; http { include mime.types; # core_module #sendfile on; tcp_nopush on; output_buffers 1 256k; #limit_rate 8m; #keepalive_timeout 30; large_client_header_buffers 64 8k; client_max_body_size 64m; open_file_cache max=256; open_file_cache_valid 300; #open_file_cache_errors on; # proxy_module proxy_pass_header Server; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header X-Real-IP $remote_addr; proxy_set_header Nginx-Rulez true; proxy_connect_timeout 30; #proxy_send_timeout 10; #proxy_read_timeout 30; proxy_buffers 8 64k; proxy_buffer_size 128k; proxy_max_temp_file_size 16m; # gzip_module #gzip on; gzip_min_length 1024; gzip_proxied any; gzip_types text/css application/x-javascript; gzip_vary on; # limit_zone_module #limit_zone remote_addr $binary_remote_addr 1m; #limit_conn remote_addr 10; #limit_zone host $host 1m; #limit_conn host 128; # log_module #log_not_found off; #access_log /var/log/nginx-access_log; # index_module index index.htm index.html index.php; # map_module map $http_host $root_dir { hostnames; default /home/nginx-data/serverroot; .example1.com /var/www/example1.com; .example2.com /var/www/example2.com; } root $root_dir; error_page 502 503 504 /50x.html; server { listen 80 default; location / { #proxy_pass http://127.0.0.1:8080; } # location ~* \.(jpg|jpeg|gif|png|ico|css|txt|js|avi|mp3|zip|rar|iso|wmv|wma|flv|mov)$ { # expires 30d; # } location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_intercept_errors on; } location = /50x.html { root html; } } }