nginx7.conf 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. user www-data;
  2. worker_cpu_affinity auto;
  3. worker_processes auto;
  4. error_log stderr error;
  5. timer_resolution 1s;
  6. #worker_rlimit_nofile 2000000;
  7. pcre_jit on;
  8. events {
  9. worker_connections 16384;
  10. multi_accept off;
  11. }
  12. http {
  13. #include /etc/nginx/mime.types;
  14. default_type application/octet-stream;
  15. access_log off;
  16. server_tokens off;
  17. sendfile on;
  18. tcp_nopush on;
  19. tcp_nodelay on;
  20. keepalive_timeout 65;
  21. keepalive_disable none;
  22. #fastcgi_ignore_client_abort on;
  23. keepalive_requests 10000000;
  24. #the bench don't use any static file
  25. #open_file_cache max=2000 inactive=20s;
  26. #open_file_cache_valid 60s;
  27. #open_file_cache_min_uses 5;
  28. #open_file_cache_errors off;
  29. #FastCGI optimizations
  30. fastcgi_buffers 256 16k;
  31. fastcgi_buffer_size 128k;
  32. fastcgi_connect_timeout 30s;
  33. fastcgi_send_timeout 60s;
  34. fastcgi_read_timeout 60s;
  35. fastcgi_busy_buffers_size 256k;
  36. fastcgi_temp_file_write_size 256k;
  37. reset_timedout_connection on;
  38. server_names_hash_bucket_size 100;
  39. fastcgi_keep_conn on;
  40. fastcgi_socket_keepalive on;
  41. upstream fastcgi_backend {
  42. server unix:/var/run/php/php-fpm.sock;
  43. keepalive 36;
  44. }
  45. server {
  46. listen 8080 reuseport;
  47. server_name localhost;
  48. root /php/;
  49. index index.php;
  50. location ~ \.php$ {
  51. fastcgi_pass fastcgi_backend;
  52. fastcgi_index index.php;
  53. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  54. include /etc/nginx/fastcgi_params;
  55. }
  56. }
  57. }